cancel
Showing results for 
Search instead for 
Did you mean: 

soap not working

Former Member
0 Kudos

Hi Experts,

I have one idoc to soap asynchronous scenario. We have used user authentication for receiver soap adapter.

While testing the wsdl in soap ui, I am getting response. I am able to open the url in browser.

From PI, messages showing successfully processed.

But user saying they are not getting any data.

Can you please advice what need to be checked for this connectivity issue or steps to check all connection set up between PI and webservice.

Waiting for response.

Accepted Solutions (0)

Answers (6)

Answers (6)

Former Member
0 Kudos

Hi,

Ifound the output generated by PI and wsdl are different.

output generated from PI:

<PostCustomerMasterData>

<customerList>

<CustomerMasterData>

<City>Broken Arrow</City>

WSDL structure:

<soapenv:Envelope

xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"

xmlns:tem="http://tempuri.org/"

xmlns:car="http://schemas.datacontract.org/2004/07/Carriage.CFSS.Electron

icOrdering.Matthews">

<soapenv:Header/>

<soapenv:Body>

<tem:PostCustomerMasterData>

<!--Optional:-->

<tem:customerList>

<!--Zero or more repetitions:-->

<car:CustomerMasterData>

<!--Optional:-->

<car:City>?</car:City>

Can anyone suggest the best way to add prefix tem and car. Can you please provide any sample java code to add two prefix namespaces.

anupam_ghosh2
Active Contributor
0 Kudos

Hi Swapnashree,

                               Please provide the complete payload generated by Pi presently.

The code will depend on source structure.

Regards

Anupam

Former Member
0 Kudos

Thanks Anupam for your response.

In my idoc to soap scenario - in the output of PI ns0 and ns1 coming as prefix and in soap prefix are tem and car.

In my proxy to soap scenario - there is no ns0 or ns1 and in soap prefix are tem and car.

1 - SOAP structure:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/" xmlns:car="http://schemas.datacontract.org/2004/07/Carriage.CFSS.ElectronicOrdering.Matthews">

   <soapenv:Header/>

   <soapenv:Body>

      <tem:PostAdvanceShippingNotice>

         <!--Optional:-->

         <tem:shippingNotice>

            <!--Optional:-->

            <car:CustomerPONumber>?</car:CustomerPONumber>

            <!--Optional:-->

            <car:DeliveryDate>?</car:DeliveryDate>

            <!--Optional:-->

            <car:DeliveryNumber>?</car:DeliveryNumber>

            <!--Optional:-->

            <car:DocumentDate>?</car:DocumentDate>

            <!--Optional:-->

            <car:Incoterms1>?</car:Incoterms1>

            <!--Optional:-->

            <car:Incoterms2>?</car:Incoterms2>

            <!--Optional:-->

            <car:Items>

               <!--Zero or more repetitions:-->

               <car:ShipmentNoticeMatthews.ItemStruct>

                  <!--Optional:-->

                  <car:HigherLevelItem>?</car:HigherLevelItem>

                  <!--Optional:-->

                  <car:ItemMaterialSalesText>?</car:ItemMaterialSalesText>

                  <!--Optional:-->

                  <car:ItemNumber>?</car:ItemNumber>

                  <!--Optional:-->

                  <car:MaterialDescription>?</car:MaterialDescription>

                  <!--Optional:-->

                  <car:MaterialNumber>?</car:MaterialNumber>

                  <!--Optional:-->

                  <car:PurchaseOrderNumberDetailLine>?</car:PurchaseOrderNumberDetailLine>

                  <!--Optional:-->

                  <car:Quantity>?</car:Quantity>

                  <!--Optional:-->

                  <car:SalesUnit>?</car:SalesUnit>

               </car:ShipmentNoticeMatthews.ItemStruct>

            </car:Items>

            <!--Optional:-->

            <car:SalesOrderDate>?</car:SalesOrderDate>

            <!--Optional:-->

            <car:SalesOrderNumber>?</car:SalesOrderNumber>

            <!--Optional:-->

            <car:ShipToPartyCity>?</car:ShipToPartyCity>

            <!--Optional:-->

            <car:ShipToPartyCountry>?</car:ShipToPartyCountry>

            <!--Optional:-->

            <car:ShipToPartyDisctrict>?</car:ShipToPartyDisctrict>

            <!--Optional:-->

            <car:ShipToPartyName>?</car:ShipToPartyName>

            <!--Optional:-->

            <car:ShipToPartyNumber>?</car:ShipToPartyNumber>

            <!--Optional:-->

            <car:ShipToPartyPostalCode>?</car:ShipToPartyPostalCode>

            <!--Optional:-->

            <car:ShipToPartyRegion>?</car:ShipToPartyRegion>

            <!--Optional:-->

            <car:ShipToPartyStreet>?</car:ShipToPartyStreet>

            <!--Optional:-->

            <car:ShipToPartyTelephone>?</car:ShipToPartyTelephone>

            <!--Optional:-->

            <car:SoldToPartyName>?</car:SoldToPartyName>

            <!--Optional:-->

            <car:SoldToPartyNumber>?</car:SoldToPartyNumber>

         </tem:shippingNotice>

      </tem:PostAdvanceShippingNotice>

   </soapenv:Body>

</soapenv:Envelope>

2 - Idoc output structure:

<?xml version="1.0" encoding="UTF-8"?>

<ns0:PostAdvanceShippingNotice xmlns:ns0="http://tempuri.org/"><ns0:shippingNotice><ns1:DeliveryDocumentNumber xmlns:ns1="http://schemas.datacontract.org/2004/07/Carriage.CFSS.ElectronicOrdering.Matthews">0080000020</ns1:D... xmlns:ns1="http://schemas.datacontract.org/2004/07/Carriage.CFSS.ElectronicOrdering.Matthews">1.000</ns1:GrossW... xmlns:ns1="http://schemas.datacontract.org/2004/07/Carriage.CFSS.ElectronicOrdering.Matthews">EDI 810</ns1:PONumber><ns1:ShippingCoditions xmlns:ns1="http://schemas.datacontract.org/2004/07/Carriage.CFSS.ElectronicOrdering.Matthews">Standard</ns1:Shi... xmlns:ns1="http://schemas.datacontract.org/2004/07/Carriage.CFSS.ElectronicOrdering.Matthews">Free on board</ns1:ShippingTerms><ns1:SoldToAddress1 xmlns:ns1="http://schemas.datacontract.org/2004/07/Carriage.CFSS.ElectronicOrdering.Matthews">New street address</ns1:SoldToAddress1><ns1:SoldToCity xmlns:ns1="http://schemas.datacontract.org/2004/07/Carriage.CFSS.ElectronicOrdering.Matthews">Louisville</ns1:S... xmlns:ns1="http://schemas.datacontract.org/2004/07/Carriage.CFSS.ElectronicOrdering.Matthews">US</ns1:SoldToCou... xmlns:ns1="http://schemas.datacontract.org/2004/07/Carriage.CFSS.ElectronicOrdering.Matthews">George Ind - SUE TST24SF</ns1:SoldToPartyName><ns1:SoldToPartyNumber xmlns:ns1="http://schemas.datacontract.org/2004/07/Carriage.CFSS.ElectronicOrdering.Matthews">0001000008</ns1:S... xmlns:ns1="http://schemas.datacontract.org/2004/07/Carriage.CFSS.ElectronicOrdering.Matthews">412-442-8272</ns1... xmlns:ns1="http://schemas.datacontract.org/2004/07/Carriage.CFSS.ElectronicOrdering.Matthews">40223</ns1:SoldTo... xmlns:ns1="http://schemas.datacontract.org/2004/07/Carriage.CFSS.ElectronicOrdering.Matthews">KY</ns1:SoldToSta...>

3 - Proxy output structure:

<:PostCustomerMasterData><:customerList><:CustomerMasterData><:City>Broken Arrow</:City><:Country>US</:Country><:CustomerName>CDT MGMT LONG TERM51</:CustomerName><:CustomerNumber>0010006021</:CustomerNumber><:Email>shawn.m.smith@us.ibm.com</:Email><:Fax>111-111-1111</:Fax><:PlantDC>1401</:PlantDC><:PostalCode>74011</:PostalCode><:Region>OK</:Region><:Street>2350 NE CT</:Street><:Telephone>111-111-1111</:Telephone></:CustomerMasterData></:customerList></:PostCustomerMasterData>

I have written one java code for idoc to soap to replace but seems its not workig.

package replaceprefix;

import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import com.sap.aii.mapping.api.AbstractTransformation;
import com.sap.aii.mapping.api.DynamicConfiguration;
import com.sap.aii.mapping.api.DynamicConfigurationKey;
import com.sap.aii.mapping.api.StreamTransformationException;
import com.sap.aii.mapping.api.TransformationInput;
import com.sap.aii.mapping.api.TransformationOutput;

public class replaceprefix extends AbstractTransformation {
public void transform(TransformationInput in, TransformationOutput out)
   throws StreamTransformationException {
  try {
  
    String sourcexml = ""; String targetxml =""; String line ="";
    InputStream ins =    in.getInputPayload().getInputStream();
    BufferedReader br = new BufferedReader( new InputStreamReader(ins));
    while ((line = br.readLine()) != null)   
     sourcexml +=line+"\n";  
    br.close();
  
    targetxml =sourcexml;
    targetxml = targetxml.replaceAll("ns0", "tem");
    targetxml = targetxml.replaceAll("ns1", "car");
    out.getOutputPayload().getOutputStream().write(targetxml.getBytes());

   } catch (Exception e) {   throw new StreamTransformationException(e.getMessage());   }
  }
}

anupam_ghosh2
Active Contributor
0 Kudos

Hi Swapnashree,

                              The cofe you wrote simple replaces tag prefix of idoc xml. The output of your code should generate the SOAP request (SOAP structure 1) and not simply replace the tag prefixes.

Thus you need to write a java code or XSLT code to create the soap request.

Regards

Anupam

Former Member
0 Kudos

Hi Swapna,

I was also facing the same issue 10 days back.For me I was also not able to open the url.

Can you please check the below thread.

http://scn.sap.com/thread/3449852

You can test the soap messages from SOAP UI

Set Below things

1. Authentication Type = Preemptive

2. username

3 password

Please try doing this.

Regards,

Abhi

Former Member
0 Kudos

Hi,

In your request properties in soapUI select Authorization Type as Preemptive

please let us know the result.

Former Member
0 Kudos

when I am selecting preemptive getting error as:

An error occurred when verifying security for the message.

Previously while testing using soap ui I was getting same error and then gave wss password type as password text then able to get that response.

former_member440061
Participant
0 Kudos

Hi,

Please check in RunTime Work Bench --> Message Monitoring if you are able to see the processed messages as successfull. You may use XPI Inspector, as mentioned by Anupam to check the issue.

Former Member
0 Kudos

Hi,

when I am testing through soap UI getting result as :

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">

   <s:Header>

      <o:Security s:mustUnderstand="1" xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">

         <u:Timestamp u:Id="_0">

            <u:Created>2013-12-12T06:40:52.488Z</u:Created>

            <u:Expires>2013-12-12T06:45:52.488Z</u:Expires>

         </u:Timestamp>

      </o:Security>

   </s:Header>

   <s:Body>

      <PostCustomerMasterDataResponse xmlns="http://tempuri.org/"/>

   </s:Body>

</s:Envelope>

When asked user to check data, they are saying they are getting in form of logs. Any suggestion if anything missing in channel configuration or in wsdl.


I treied to check through XI Inspector but not able to get anything.

iaki_vila
Active Contributor
0 Kudos

Hi Swapanashree,

Is PI outgoing message equals to SOAPui test XML?, i've noticed that the message has wsse security tags, are you generating manually that tags?, are you using SOAP AXIS?

Regards.

monikandan_p
Active Participant
0 Kudos

Hi Swapna,

   Kindly follow the below link.

Best Regards,

Monikandan.

anupam_ghosh2
Active Contributor
0 Kudos

Hi Swanashree,

                           There might be multiple reasons for this problem. Network connectivity, problem in receiver server port etc. Things you can check

1. Telnet/Ping target server from client network , check if the request is able to reach the target server.

2. There may be problems in receiver server accepting the payload from PI. This they need to check from their end.

3. Try  XPI inspector. For details check this wonderful blog by Michal Krawczyk



Regards

Anupam