none
Response message from SAP AII in WCF LOB ADAPTER RRS feed

  • Question

  •  

    Hi,

     

    We are posting an xml message to http URI which is exposed in SAP AII from WCF LOB Adapter (client derived from ClientBase<IRequestChannel>)

     

    Message returnMessage = null;

    XmlReader reader;

    request = Message.CreateMessage(MessageVersion.None, String.Empty, reader);

    returnMessage = this.Channel.Request(request);

     

    SAP AII is able to receive the message and send a confirmation message as a string (“HTTP OK”) to WCF LOB Adapter.

    The Problem is that WCF is not able to accept the response message as a string.

    How do we receive a string as return message in WCF LOB ADAPTER?

     

    Error message is{"There is a problem with the XML that was received from the network. See inner exception for more details."} Message = "Unexpected end of file."

     

    I appreciate your help. Thanks in advance 

    Regards,
    Manoj

     

    Friday, January 4, 2008 4:26 AM

Answers

All replies

  •  

    Could you please post your Xml here? and also the object for which you creating Xml?

    Thanks

    Taruna

    Friday, January 4, 2008 6:21 AM
  • Hi Taruna,

     

    Thanks for the reply.

    Here is the xml message we are posting to SAP AII. The SAP AII send reply as "OK".

    Problem is that we are not able to receive as a string in the WCF LOB Adapater

     

    string sendData = "<?xml version='1.0' encoding='utf-8'?><pmlcoreTongue Tiedensor xmlnsStick out tonguemlcore='urn:autoidTongue Tiedpecification:interchangeStick out tongueMLCore:xmlTongue Tiedchema:1' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsiTongue TiedchemaLocation='urn:autoidTongue Tiedpecification:interchangeStick out tongueMLCore:xmlTongue Tiedchema:1./PML/SchemaFiles/Interchange/PMLCore.xsd'><pmluid:ID xmlnsStick out tonguemluid='urn:autoidTongue Tiedpecification:universal:Identifier:xmlTongue Tiedchema:1'/><pmlcoreSurprisebservation><pmlcoreBig SmileateTime>2007-12-13T09:04:15.672</pmlcoreBig SmileateTime><pmlcore:Command>LOADPTA</pmlcore:Command><pmlcore:Tag><pmluid:ID xmlnsStick out tonguemluid='urn:autoidTongue Tiedpecification:universal:Identifier:xmlTongue Tiedchema:1' schemeID='EPC_1.30'>30140242203606400000006D</pmluid:ID><pmlcoreBig Smileata><pmlcore:XML><EPCStatus/><Memory/></pmlcore:XML></pmlcoreBig Smileata></pmlcore:Tag><pmlcore:Tag><pmluid:ID xmlnsStick out tonguemluid='urn:autoidTongue Tiedpecification:universal:Identifier:xmlTongue Tiedchema:1' schemeID='EPC_1.30'>30140242203606400000006F</pmluid:ID><pmlcoreBig Smileata><pmlcore:XML><EPCStatus/><Memory/></pmlcore:XML></pmlcoreBig Smileata></pmlcore:Tag><pmlcoreBig Smileata><pmlcore:XML><DOCUMENT_NO>0080015479</DOCUMENT_NO><LogicalDeviceID>RKT_DG_LOAD</LogicalDeviceID></pmlcore:XML></pmlcoreBig Smileata></pmlcoreSurprisebservation></pmlcoreTongue Tiedensor>";

     

    Regards,

    Manoj

    Friday, January 4, 2008 11:07 AM
  • Are you using the WCF LOB SAP Adapter which is part of the Adapter Pack? If so, can you attach your client project here?
    Friday, January 4, 2008 1:01 PM
  •  

    We are not using any LOB SAP Adapter. we are just submmiting to a URI of SAP system using Channel.request()

    The return response from the SAP system would be "OK" as a string which we are not able to capture in the adapter. Please Refer my earlier code above.

     

    Thx,

    Manoj

    Monday, January 7, 2008 4:08 AM
  • Hmm .. I'm getting a little confused. You've earlier mentioned that you are using the WCF LOB Adapter. Which Adapter?
    Which Binding are you using to create your channel factory and channel?
    Monday, January 7, 2008 4:16 AM
  • Xml looks complete, but may I know for which object/BAPI/RFC you are sending this inpu Xml, I believe there might be some nodes missing in this which are mandatory.

     

    Monday, January 7, 2008 6:32 AM
  • If you don't mind attach your project code here, so that I can execute on my machine, and check it. Since I also use xml as inout for channels.

     

    Monday, January 7, 2008 6:35 AM
  • I see the problem in you Xml,

    <pmlcore:Tag>

    <pmluid:ID xmlnsmluid='urn:autoidpecification:universal:Identifier:xmlchema:1' schemeID='EPC_1.30'>30140242203606400000006D</pmluid:ID>

    <pmlcoreata><pmlcore:XML>

    <EPCStatus/><Memory/>

    </pmlcore:XML></pmlcoreata>

    </pmlcore:Tag>

     

    I think you can try the below Xml: while sending Xml if the Xml node doesnt have value to be sent or if Xml Node is not mandatory then Can you simply pass just the parent node like here: EPCStatus & Memory dont have data to be passed so this can be removed and simply can use the parent which is pmlcore:XML since this node as well has no data so can remove this and put the parant only like <pmlcoreata></pmlcoreata> if it's not mandatory to pass the null nodes.

    Please try the below combinations;

     

     

    <pmlcore:Tag>

    <pmluid:ID xmlnsmluid='urn:autoidpecification:universal:Identifier:xmlchema:1' schemeID='EPC_1.30'>30140242203606400000006D</pmluid:ID>

    <pmlcoreata><pmlcore:XML></pmlcore:XML></pmlcoreata>

    </pmlcore:Tag>

     

    or

     

    <pmlcore:Tag>

    <pmluid:ID xmlnsmluid='urn:autoidpecification:universal:Identifier:xmlchema:1' schemeID='EPC_1.30'>30140242203606400000006D</pmluid:ID>

    <pmlcoreata</pmlcoreata>

    </pmlcore:Tag>

     

    or

     

    <pmlcore:Tag>

    <pmluid:ID xmlnsmluid='urn:autoidpecification:universal:Identifier:xmlchema:1' schemeID='EPC_1.30'>30140242203606400000006D</pmluid:ID>

    <pmlcoreata><pmlcore:XML>

    <EPCStatus>

    <EPCStatus/>

    <Memory>

    <Memory/>

    </pmlcore:XML></pmlcoreata>

    </pmlcore:Tag>

    Monday, January 7, 2008 6:42 AM
  • I see the problem in you Xml,

    <pmlcore:Tag>

    <pmluid:ID xmlnsmluid='urn:autoidpecification:universal:Identifier:xmlchema:1' schemeID='EPC_1.30'>30140242203606400000006D</pmluid:ID>

    <pmlcoreata><pmlcore:XML>

    <EPCStatus/><Memory/>

    </pmlcore:XML></pmlcoreata>

    </pmlcore:Tag>

     

    I think you can try the below Xml: while sending Xml if the Xml node doesnt have value to be sent or if Xml Node is not mandatory then Can you simply pass just the parent node like here: EPCStatus & Memory dont have data to be passed so this can be removed and simply can use the parent which is pmlcore:XML since this node as well has no data so can remove this and put the parant only like <pmlcoreata></pmlcoreata> if it's not mandatory to pass the null nodes.

    Please try the below combinations;

     

     

    <pmlcore:Tag>

    <pmluid:ID xmlnsmluid='urn:autoidpecification:universal:Identifier:xmlchema:1' schemeID='EPC_1.30'>30140242203606400000006D</pmluid:ID>

    <pmlcoreata><pmlcore:XML></pmlcore:XML></pmlcoreata>

    </pmlcore:Tag>

     

    or

     

    <pmlcore:Tag>

    <pmluid:ID xmlnsmluid='urn:autoidpecification:universal:Identifier:xmlchema:1' schemeID='EPC_1.30'>30140242203606400000006D</pmluid:ID>

    <pmlcoreata</pmlcoreata>

    </pmlcore:Tag>

     

    or

     

    <pmlcore:Tag>

    <pmluid:ID xmlnsmluid='urn:autoidpecification:universal:Identifier:xmlchema:1' schemeID='EPC_1.30'>30140242203606400000006D</pmluid:ID>

    <pmlcoreata><pmlcore:XML>

    <EPCStatus>

    </EPCStatus>

    <Memory>

    </Memory>

    </pmlcore:XML></pmlcoreata>

    </pmlcore:Tag>

    Monday, January 7, 2008 6:43 AM
  • Hi,

     

    We have got the solution. Please refer these links for more information

     

    Link for creating textmessage encoder

    http://msdn2.microsoft.com/en-us/library/ms751486.aspx

     

    http://technet.microsoft.com/en-s/library/system.servicemodel.channels.messageencodingbindingelement.aspx

     

    Thanks for all your support and responses.

     

    Thanks & Regards,

    Manoj

     

    Tuesday, January 8, 2008 5:56 AM