on 06-13-2012 1:14 PM
Hi All,
I have a scenario where I need to connect ASTEA webservice from SAP PI. Please let me know if anybody had done any interfaces with ASTEA.
Regards,
Kevin
if it is a document or RPC style WS, then it is a standard implementation as any normal WS scenario in PI
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
this is a case for a BPM. Call the first WS followed by second.
Also for passing the whole XML into a tag, refer : http://wiki.sdn.sap.com/wiki/display/XI/Whole+Payload+to+a+XML+field
I am getting the following error in UDF
Module exception: 'SOAP Error'. Cause Exception: 'SOAP: response message contains an error XIAdapter/PARSING/ADAPTER.SOAP_EXCEPTION - soap fault: Server was unable to read request. ---> There is an error in XML document (1, 97). ---> <Envelope xmlns='http://schemas.xmlsoap.org/soap/envelope'> was not expected.'. com.sap.aii.mapping.lookup.LookupException: Error when calling an adapter by using the communication channel |
this is the UDF
AbstractTrace trace = container.getTrace();
String sessionID = "";
try
{
Channel channel = LookupService.getChannel("BC_ASTEA","CC_CustomerExtract_SOAP");
SystemAccessor accessor = LookupService.getSystemAccessor(channel);
// The Request message in XML. prodividing an example here
String prefix = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+ "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">";
// + "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:urn=\"http://astea.com/message\">"
// + "<soapenv:Header/> ";
String suffix = "<soapenv:Body>" + "<Login soapenv:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">"
+ "<User xsi:type=\"xsd:normalizedString\">" + var1 + "</User>" + "<Password xsi:type=\"xsd:normalizedString\">" + var2 + "</Password>" + "<Profile xsi:type=\"xsd:normalizedString\">" + var3 + "</Profile>" + "</Login>";
String envelope = "</soapenv:Body></soapenv:Envelope>";
String SOAPxml = prefix + suffix + envelope ;
InputStream inputStream =new ByteArrayInputStream(SOAPxml.getBytes());
XmlPayload payload = LookupService.getXmlPayload(inputStream);
Payload SOAPOutPayload = null;
//The response will be a Payload. Parse this to get the response field out.
SOAPOutPayload = accessor.call(payload);
/* Parse the SOAPPayload to get the SOAP Response back. */
InputStream inp = SOAPOutPayload.getContent();
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
/* Create DOM structure from input XML */
DocumentBuilder builder = factory.newDocumentBuilder();
Document document = builder.parse(inp);
/* SessionID is available in the Result in the Response XML */
NodeList list = document.getElementsByTagName("Result");
Node node = list.item(0);
if (node != null) { node = node.getFirstChild();
if (node != null) { sessionID = node.getNodeValue(); } }
}
catch (Exception e)
{ trace.addWarning("Error" + e); }
return sessionID;
this is the request message from soap ui
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:mes="http://astea.com/message/">
<soapenv:Header/>
<soapenv:Body>
<mes:Login soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<User xsi:type="xsd:normalizedString"></User>
<Password xsi:type="xsd:normalizedString"></Password>
<Profile xsi:type="xsd:normalizedString"></Profile>
</mes:Login>
</soapenv:Body>
</soapenv:Envelope>
response message from soap ui
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://www.astea.com/webservices/" xmlns:types="http://www.astea.com/webservices/encodedTypes" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<q1:LoginResponse xmlns:q1="http://astea.com/message/">
<Result xsi:type="xsd:normalizedString">6a534642f6ab0-4531-45f2-894b-9721d37605d8TESTPROD</Result>
</q1:LoginResponse>
</soap:Body>
</soap:Envelope>
please help
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
// + "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:urn=\"http://astea.com/message\">"
// + "<soapenv:Header/> ";
I think some string concatenate issues here. Please check whether you construct the string for envelope,header and body in the order with all the namespace it expects. If you dont want any namespace or string portion, please take out from the code and dont use comment statements as above. Check in your log you correctly send the request message as per the requirement.
Kevin,
Is the client capable of making multiple calls keeping the session id? If so you can use state-full session handling approach. The client should first send the LogIn request. Once you have the session ID, you should be able to perform all the subsequent operations.
Please refer to additional details in http://scn.sap.com/docs/DOC-16148 on handling state-full web service calls using Axis framework. You may not be able to use this document as is. But it should give some idea on how to handle state-full sessions.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your replies. There is correction .. we have only one wsdl for it in that actions like login ans send synchronic ( given below)
<wsdl:definitions targetNamespace="http://www.astea.com/webservices/"><wsdl:types/><wsdl:message name="LoginSoapIn"><wsdl:part name="User" type="s:normalizedString"/><wsdl:part name="Password" type="s:normalizedString"/><wsdl:part name="Profile" type="s:normalizedString"/></wsdl:message><wsdl:message name="LoginSoapOut"><wsdl:part name="Result" type="s:normalizedString"/></wsdl:message>
...
<wsdl:message name="SendSynchronicSoapIn"><wsdl:part name="SessionID" type="s:normalizedString"/><wsdl:part name="XML" type="s:normalizedString"/></wsdl:message>
I am trying call soap lookup in UDF. As a result of login I'll get a session id as response. This I am putting in to send sychronic message. there I am trying to give this session id and message as encoded xml.
These are my doubts
1. how can I create the request message in UDF as per this above format.( possibly give the java code to lookup and get the session id )
2. how can I encode the xml in UDF. Here the source message I can't encode. They have a separate xml format for it.
Thanks,
Kevin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
>These are my doubts
1. how can I create the request message in UDF as per this above format.( possibly give the java code to lookup and get the session id )
2. how can I encode the xml in UDF. Here the source message I can't encode. They have a separate xml format for it.
You basically need some ten lines of coding for UDF soap lookup. Please check Bhavesh reply on this thread. You will find solution for this
Hi ,
If you want to avoind BPM design then perfrom SOAP look up in PI mapping level to to execute Login web service after that call second web service.
Passing whole XML to WSDL tag very much possible you can use option return as XML at mapping level.
Regards,
Raj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can do this way. Use login ws in the mapping (since there wont be complex data structure) and after successful login response , then use the second webservice as target structure. This way you can handle both WS together. Talk with target system and know more about authentication and other connectivity standards.
Hope that helps
Refer SCN for soap lookup for mapping and soap receiver for the configuration of wsdl to consume.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.