none
calling webservices using messaging only scenario. RRS feed

  • Question

  • Hi ..

    When i'm trieng to acheive calling webservice(SOAP Adapter/biztalk 2006) in messaging only scenario(without using orchestration ).i'm running into serialization issue.

    Error:

    Failed to serialize the message part "sName" into the type "String" using namespace "". Please ensure that the message part stream is created properly.

    Friday, March 4, 2011 6:13 AM

Answers

  • Check what precedes your element name sName and check whether it is an optional node. Normally this problem happens when some nodes are declared as optional and they are not present in the message, and this SOAP doesn't understand. There should not be any optional elements in your schema. Nillable elements are however ok.

    Also have you tried to validate your Xml string against the Schema?
    I’d save your string as an Xml file and make sure it validates.  simply validate the failed message (retrieved from the Admin Console) against the schema generated from the WSDL, using the Visual Studio ‘Validate Instance‘ schema menu option. You’ll be presented with a list of errors that can then be resolved.


    Please mark as answer if this helps you. Thanks and warm regards Ambar Ray Solution Architect - Microsoft Technologies
    Friday, March 11, 2011 3:50 PM

All replies

  • Hi,

    Before creating the webservice set the property "EnableSafeTyping" equals to true.

    This might avoid your problem.

    Regards,

    K.T.Balaji

    Friday, March 4, 2011 8:36 AM
  • Hey Srikanth,

    This happens when there is a datatype mismatch between the source field and the destination you are trying to map.

    Route your maps output(which contains "sName") to a folder using File adapter.

    Now try validating this output against the Webservice Schema and you will get the same error.

    So fixing the sName to have a valid string value will resolve this.

    Thanks.

    Please mark this as answered if it helps.


    Sriram N http://srirambiztalks.wordpress.com/
    Saturday, March 5, 2011 2:02 AM
  • Hi,

    I suggest you look into this post. To resolve this validate the failed message (retrieved from the Admin Console) against the schema generated from the WSDL, using the Visual Studio ‘Validate Instance‘ schema menu option. You’ll be presented with a list of errors that can then be resolved.

    HTH

    Regards,

    Steef-Jan Wiggers - MVP & MCTS BizTalk Server
    blog: http://soa-thoughts.blogspot.com/
    If this answers your question please mark it accordingly


    BizTalk
    Saturday, March 5, 2011 5:26 AM
    Moderator
  • Check what precedes your element name sName and check whether it is an optional node. Normally this problem happens when some nodes are declared as optional and they are not present in the message, and this SOAP doesn't understand. There should not be any optional elements in your schema. Nillable elements are however ok.

    Also have you tried to validate your Xml string against the Schema?
    I’d save your string as an Xml file and make sure it validates.  simply validate the failed message (retrieved from the Admin Console) against the schema generated from the WSDL, using the Visual Studio ‘Validate Instance‘ schema menu option. You’ll be presented with a list of errors that can then be resolved.


    Please mark as answer if this helps you. Thanks and warm regards Ambar Ray Solution Architect - Microsoft Technologies
    Friday, March 11, 2011 3:50 PM
  • Hey Srikanth,

    Can you please provide your webservice schema and the xml you are passing to it.

    Thanks.


    Sriram N http://srirambiztalks.wordpress.com/
    Saturday, March 12, 2011 4:50 AM
  • 1.I Have Created one webservice. with one web method.

    public string sayHi(string sName)

    {

    return "Hi "+sName;

    }.

    2 .After that i created proxy to this WS

    3.created classlibrary by adding above proxy cls.and added this to GAC.

    4.Biztalk: created schema structures(excluding soap headers !) according to  WSDL of the above WS.

    5.deployed the biztalk app.

    6.configured receive port to publish into msgbox.

    7.configured solicitresponce port with soap adapter acordingly.(tried with passthrough and xmlreceivepipeline).

    8.when i place the xml file.it is publishing the msg into msg box.when it is routing the msg to WService it is not able to  send.

    9.getting error below.

    Error:

    Failed to serialize the message part "sName" into the type "String" using namespace "". Please ensure that the message part stream is created properly.


    Srikanth Peddy. MCTS-BizTalk Server Please mark as answered .
    Monday, March 14, 2011 5:05 AM
  • Hi Srikanth,

    The string data type is in namespace "http://www.w3.org/2001/XMLSchema". It seems you are missing something during the creation of schema for the request message as in this error message you are getting namespace as "". Can you please share the schema you have created.


    Rohit
    Thursday, March 31, 2011 11:48 AM
    Moderator
  • Hi,

    An option is to build a .net console/windows application, add a web reference to the webservice and try to serialize each argument to the corresponding type. For reference see this post. If that doesn't help try Amber's suggestion, and for reference see this post.

    HTH

    Regards,

    Steef-Jan Wiggers - MVP & MCTS BizTalk Server
    blog: http://soa-thoughts.blogspot.com/
    If this answers your question please mark it accordingly


    BizTalk
    Wednesday, April 13, 2011 7:06 PM
    Moderator