cancel
Showing results for 
Search instead for 
Did you mean: 

XML Header missing - WebAS to PI, Java Proxy as Sender

former_member206107
Active Participant
0 Kudos

Hi Experts,

I am trying to send a XML message from WebAS to PI using JPR (Java Proxy as Sender).

I have constructed the XML and sending the XML to the proxy. The constructed XML looks like

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?><Envelope xmlns:eb="http://www.ebxml.org/namespaces/messageHeader"><eb:MessageHeader eb:version="2.0"><eb:From><eb:PartyId eb:type="GLN">0079400000002</eb:PartyId><eb:Role>Internal Catalogue</eb:Role></eb:From><eb:To><eb:PartyId eb:type="GLN"></eb:PartyId><eb:Role>Manufacturer</eb:Role></eb:To><eb:CPAId>NotApplicable</eb:CPAId><eb:ConversationId>NotApplicable</eb:ConversationId><eb:Service eb:type="Unilever Item Import Response XML version 1.07">DataCatalogue</eb:Service><eb:Action>DataCatalogueResponse</eb:Action><eb:MessageData><eb:MessageId>ZZ-10079400050714-US-0079400000002-201111081211147</eb:MessageId><eb:Timestamp>2011-11-09 09:16:52.153</eb:Timestamp></eb:MessageData></eb:MessageHeader><CatalogResponse><ResponseHeader><DestinationHeader></DestinationHeader><SourceHeader>0079400000002</SourceHeader><MessageIDHeader>NotApplicable</MessageIDHeader><TimeStampHeader>NotApplicable</TimeStampHeader><CorrelationIDHeader>null</CorrelationIDHeader><PrincipalHeader>NotApplicable</PrincipalHeader></ResponseHeader><ResponseDetail><OverallResultCode>810</OverallResultCode><OverallResultMessage>DATA_ERROR</OverallResultMessage><TxnDetail><Type>ITEM</Type><Action>ADD</Action><ID1>10079400050714</ID1><ID2>US</ID2><RefData1>null</RefData1><RefData2>240</RefData2><ResultCode>810</ResultCode><ResultMessage>DATA_ERROR</ResultMessage></TxnDetail></ResponseDetail></CatalogResponse></Envelope>

The code I am using to call the sender Java proxy,

public boolean send_to_PI(String XMLMessage)

{

try

{

Envelope_Type envelope = new Envelope_Type();

envelope.fromXml(XMLMessage);

ItemLinkResponseOut_PortTypeBean bean = new ItemLinkResponseOut_PortTypeBean();

bean.itemLinkResponseOut(envelope);

logger_Loc.infoT(PREFIX+"Message sent to PI");

return true;

}

catch(Exception E)

{

logger_Loc.errorT(PREFIX"Exception in proxy: "E);

return false;

}

}

When I see the payload in MDT for the processed message, the XML header is missing. The pay load contect as below,

- <Envelope>

- <MessageHeader>

- <From>

<PartyId>0079400000002</PartyId>

<Role>Internal Catalogue</Role>

</From>

- <To>

<Role>Manufacturer</Role>

</To>

<CPAId>NotApplicable</CPAId>

<ConversationId>NotApplicable</ConversationId>

<Service>DataCatalogue</Service>

<Action>DataCatalogueResponse</Action>

- <MessageData>

<MessageId>ZZ-10079400050714-US-0079400000002-201111081211147</MessageId>

<Timestamp>2011-11-09 09:20:41.83</Timestamp>

</MessageData>

</MessageHeader>

- <CatalogResponse>

- <ResponseHeader>

<SourceHeader>0079400000002</SourceHeader>

<MessageIDHeader>NotApplicable</MessageIDHeader>

<TimeStampHeader>NotApplicable</TimeStampHeader>

<CorrelationIDHeader>null</CorrelationIDHeader>

<PrincipalHeader>NotApplicable</PrincipalHeader>

</ResponseHeader>

- <ResponseDetail>

<OverallResultCode>810</OverallResultCode>

<OverallResultMessage>DATA_ERROR</OverallResultMessage>

- <TxnDetail>

<Type>ITEM</Type>

<Action>ADD</Action>

<ID1>10079400050714</ID1>

<ID2>US</ID2>

<RefData1>null</RefData1>

<RefData2>240</RefData2>

<ResultCode>810</ResultCode>

<ResultMessage>DATA_ERROR</ResultMessage>

</TxnDetail>

</ResponseDetail>

</CatalogResponse>

</Envelope>

Am I missing any configuration or I am missing something in the code? Please help.

Thanks and best regards,

Arun prabhu S

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member206107
Active Participant
0 Kudos

Hi,

Some more text are also missing in the payload from the constructed XML like "eb:" in each tag and ""xmlns:eb=\"http://www.ebxml.org/namespaces/messageHeader\" in the <Envelop > tag.

This XML is going to PI where it expects these information.

Thanks and best regards,

Arun prabhu S

stefan_grube
Active Contributor
0 Kudos

> Some more text are also missing in the payload from the constructed XML like "eb:" in each tag and ""xmlns:eb=\"http://www.ebxml.org/namespaces/messageHeader\" in the <Envelop > tag.

Check your service interface which you use to generate the Java proxy.

This type of interface cannot be generated with the data type editor inside ESR.

So you have to use an external WSDL and upload this to PI.

former_member206107
Active Participant
0 Kudos

The problem is, the XML header "<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>" is missing in payload

stefan_grube
Active Contributor
0 Kudos

> The problem is, the XML header "<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>" is missing in payload

that is the way java proxy work.

why is this a problem? xml header is not mandantory.