1 Reply Latest reply: Feb 17, 2013 7:55 AM by Sanjay Bharatiya RSS

    Calling B2B Web Service from .Net


      I am able to successfully call GetTPAConfigService from C# .Net. I get back the results from the service as expected.

      However I am not able to successfully call OutboundService web service on the same pattern. Following is the way I am setting the parameters in C# -:

      ServiceReference1.OutboundServiceRequest outRequest = new ServiceReference1.OutboundServiceRequest();

      ServiceReference1.PartyId sender = new ServiceReference1.PartyId();
      sender.Value = "b2b1";
      sender.type = "AS2 Identifier";

      ServiceReference1.PartyId receiver = new ServiceReference1.PartyId();
      receiver.Value = "b2b2";
      receiver.type = "AS2 Identifier";

      outRequest.to = receiver;
      outRequest.from = sender;

      ServiceReference1.ItemsChoiceType[] docPropNames = new ServiceReference1.ItemsChoiceType[]
      {   ServiceReference1.ItemsChoiceType.documentProtocolVersion,
      outRequest.ItemsElementName = docPropNames;

      string[] docProps = new string[] { "1.0", "Xml"};
      outRequest.Items = docProps;

      outRequest.payload = "<ichicsr><header>i am header</header><body>i am body </body></ichicsr>";

      ServiceReference1.B2BWSDefaultPortClient client = new ServiceReference1.B2BWSDefaultPortClient();

      ServiceReference1.OutboundServiceResponse outResponse = client.Outbound(outRequest);

      An exception is received that

      org.xml.sax.SAXParseException: XML-24129: (Error) prefix of qname \"xsd\" can not be resolved,
      org.xml.sax.SAXParseException: XML-24065: (Error) xsi:type \"xsd:string\" not resolved to a type definition]"

      My document is configured to be an Xml document in B2B.

      The payload parameter is AnyType in wsdl. I want to understand what exactly is expected in this parameter? I have tried with Byte Arrays as well then instead of string I get error for "xsd:base64Binary". I believe similar problem may be faced in java as well.

        • 1. Re: Calling B2B Web Service from .Net
          Sanjay Bharatiya
          Hi Punit,

          In C# is there any way to specify the associated namespaces. Like you are setting the docProps similary can you add the expected namespaces along with the prefix (used for the namespace).

          Also if you can check the XML (expected from B2B) separately then could you verify if the prefix xsd is defined in the XML.