Webservices & XSLT

Hi everyone,
I'm very new to the objective-c language but have been tasked with looking into it for work.
I've been googling for a few days now looking into how to consume a .asmx (.net) webservice from the iPhone. It sounds like this isn't as easy as we are used to via Visual Studio.
From what I can find, there is no easy way to do it on the iPhone, however serveral people mention using http requests/responses. This would therefore require me to create the message body ie. the soap envelope etc. myself.
So a few of questions...
- Firstly can anybody point me towards a good example of http requests/responses?
- Is it possible to use XSLT on the iPhone?
- Have I missed something obvious? is there an easier way? Can you point me at a good example?
Thanks in advance.
David

http://developer.apple.com/documentation/Cocoa/Conceptual/URLLoadingSystem/URLLo adingSystem.html

Similar Messages

  • Webservice returning string (but I need XML for XSLT Tranformation)

    Hello everybody,
    I have configured an ip with a webservice. So far so good - everything works fine.
    Now I want to transform the output of the webservice with xslt. The webservice returns the data as a String in form of XML.
    e.g.
        <!XML>
    <!String>
    <!String> </b>
    </Bill> <!XML>
    But XSLT don't find e.g the node , because it is a String. I think the right way is first to transform the String into XML. I tried this step with Java with the method
    public void execute(InputStream inputStream, OutputStream outputStream)
            throws StreamTransformationException {
    but it doesn't work. I am not sure, if this is the right way.I have searched for a code sample, but I didn't find anything.
    What do you think?
    Do you have a code sample?
    This would be great!
    Best regards,
    Jürgen

    Hello Bhavesh,
    thx very much for your help.
    Here is my Java Mapping:
    public class ModusLebenTransformation implements StreamTransformation
    public static byte[] readStream(InputStream in, boolean close)
        throws IOException
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        int c = in.read();
        while (c > -1)
            out.write(c);
            c = in.read();
        out.flush();
        byte[] result = out.toByteArray();
        out.close();
        if (close)
            in.close();
        return result;
    public void setParameter(Map map) {
    public void execute(InputStream inputStream, OutputStream outputStream)
            throws StreamTransformationException {
       try {
    TransformerFactory tFactory = TransformerFactory.newInstance();
                Transformer transformer = tFactory.newTransformer();
       StreamResult result = new StreamResult(outputStream);
    String input = new String(readStream(inputStream,true));
    transformer.transform(new StreamSource(input), result);      
      } catch (Exception e) {
                 throw new StreamTransformationException("Mapping failed", e);
    But I don't know if this code is enough to convert the String( from the webservice) into XML.
    And then I would like to use XSLT for transformation in a new mapping step.
    Do you think this is possible?
    Do you have a code sample, that will tranform the String (from the webservice) into XML?
    This would be very helpful!
    regards,
    Jürgen

  • Webservice Proxy from WSDL creates faulty XSLT

    Hi,
    I have a WSDL which generates a webservice Proxy in SE80 just fine.
    When I run the webservice the request is formed properly and I get a response from the webservice. The problem is that the generated XSLT seems to be wrong. When I use the testing tool of the proxy class I can see "original response" and "response".
    "response" was parsed by the XSLT I guess which gives me an empty XML-structure while the "original response" looks good.
    How can I fix this? The XSLT is quite complicated and Im not sure what I can do.
    Is it a WSDL-problem?

    Did you solve this ? I seem to have a similar problem after changing the weservice defintion I have a repsonse and Original response in the test tab. The Original response is filled and the response stays empty.
    However when I call the webservice in an ABAP program the response is empty.
    Addition.
    I have found the cause of this and will mention it here for anyone who has the same problem.
    In my case the reason for this behavior was a data element that was generated as type XSDDATETIME_Z. Once I changed it to XSDDATETIME_ISO everything was working OK again.

  • Issue in parsing the response of a WebService in Service Link

    I am getting issues in connecting an external (non cisco) application via WebService. Appreciate if anyone can help in fixing the issue. I am using 9.3.2 Patch 6.
    Connectivity to an external system (a 3rd party application in my firm) was achieved via WebService using the ServiceLink module.
    Used the Outbound HTTP/WS Adapter where I am sending request and receiving response (bi-direction).
    Successfully constructed and passed the XML request to the WebService.
    Received response from the WebService as an XML / Soap Message which is then wrapped with the <Message> tag with the channel-id attribute successfully.
    Designed a XSL Transformation (For this WebService, the XSLT did not generated automatically) which, I hope is not being applied properly in CPSC; but working fine outside of CPSC when I have checked the response XML with the XSLT in an online editor (http://www.freeformatter.com/xsl-transformer.html). Everything looks perfect in this editor where I have issues in CPSC.
    I am getting a Transformation exception in CPSC and the response message was unable to convert into the nsXML. The exception I am receiving is below. Not sure whether it is due to the namespace or something else..
    Note: I am having this issue in this Agent/WebService alone. I have tested with couple other WebServices where I didn't have any issues in getting the response and update the field in CPSC form successfully. So, I believe that there are no issues in the parser in our server.
    Exception Received:
    org.xml.sax.SAXParseException: Premature end of file. at org.apache.xerces.parsers.DOMParser.parse(Unknown Source) at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source) at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:124) at com.newscale.bfw.util.XMLValidator.validate(XMLValidator.java:147) at com.newscale.is.core.MessageExecutor.processNSTaskTransportMessage(MessageExecutor.java:135) at com.newscale.is.core.MessageExecutor.processTransportMessage(MessageExecutor.java:431) at com.newscale.is.core.MessageExecutor.processSynchronousOutboundMessage(MessageExecutor.java:526) at com.newscale.is.adk.OutboundAdapterUtil.processSynchronousResponse(OutboundAdapterUtil.java:44) at com.newscale.is.adapter.http.HTTPOutboundAdapter.call(HTTPOutboundAdapter.java:190) at com.newscale.is.adapter.http.HTTPOutboundAdapter.processMessage(HTTPOutboundAdapter.java:147) at com.newscale.is.core.MessageRouter.routeMessage(MessageRouter.java:115) at com.newscale.is.core.MessageExecutor.processOutboundMessage(MessageExecutor.java:604) at com.newscale.is.core.MessageExecutor.processMessage(MessageExecutor.java:125) at com.newscale.is.core.QueueListener.handleTextMessage(QueueListener.java:91) at sun.reflect.GeneratedMethodAccessor110.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.camel.component.bean.MethodInfo.invoke(MethodInfo.java:340) at org.apache.camel.component.bean.MethodInfo$1.proceed(MethodInfo.java:237) at org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:168) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:99) at org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:73) at org.apache.camel.impl.ProcessorEndpoint.onExchange(ProcessorEndpoint.java:101) at org.apache.camel.impl.ProcessorEndpoint$1.process(ProcessorEndpoint.java:71) at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:115) at org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:285) at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:110) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:71) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:91) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:322) at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:213) at org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:45) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultChannel.java:303) at org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:45) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWorkProcessor.java:150) at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:117) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90) at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:71) at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:99) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:86) at org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:105) at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:561) at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:499) at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:467) at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:325) at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:263) at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1059) at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1051) at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:948) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662)
    Sample XML File received as response from the WebService – which then wrapped with the <message> tag along with appropriate channel-id.
    <message channel-id="10a60e45-65d4-40c0-826f-1a91d2135da0">
    <?xml version="1.0"?>
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="
    http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <soap:Body>
    <ns:ITSPResponse xmlns:ns="urn:PegaRULES:SOAP:BNYMDataITSPTest:Services">
    <Output>Test IT Service Portal - 1</Output>
    </ns:ITSPResponse>
    </soap:Body>
    </soap:Envelope>
    </message>
    XSL Transformation
    <?xml version="1.0"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="
    http://www.w3.org/1999/XSL/Transform" xmlns:ns="urn:PegaRULES:SOAP:BNYMDataITSPTest:Services">
    <xsl:template match="/">
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns="urn:PegaRULES:SOAP:BNYMDataITSPTest:Services">
    <message>
    <xsl:attribute name="channel-id">
    <xsl:value-of select="//@*[local-name()='channel-id']" />
    </xsl:attribute>
    <send-parameters>
    <agent-parameter>
    <name>Output</name>
    <value> <xsl:value-of select="//*[local-name()='Output']" /> </value>
    </agent-parameter>
    </send-parameters>
    </message>
    </xsl:template>
    </xsl:stylesheet>

    The reply I got from Cisco Engineering team for this is to get the response as a soap message than XML data.
    The tag should not be available in the response received. If we don't have this, the response will still consider as a valid XML / Soap message after wrapped by the tag.
    If we have the tag in the response, after wrapping the tag, the format of the response will not be in good format.
    Also, Cisco Engineering team has confirmed that it is not possible to remove the tag from CPSC. It should be removed by the WebService providers while sending the response.
    For my case, I am consuming the WebService from a tool similar to CPSC where the entire settings has to be changed to send the response format as soap message than XML. So, we need to have another WebService as a middleware! Bad day!

  • Error while testing the webservice through SOAMANAGER

    Hi All,
    I have created a webservice from a Function module ( RFC enabled). I am getting an error while testing the webservice from the SOAMANAGER but the function module is working fine giving proper output.
    The error is
    REQUEST:
    POST /sap/bc/srt/rfc/sap/zws_test_cms_bp_fac/600/zws_test_cms_bp_fac/zws_test_cms_bp_fac HTTP/1.1
    Host: ed1app.corp.fcc.ca:49000
    Content-Type: text/xml; charset=UTF-8
    Connection: close
    Authorization: <value is hidden>
    Content-Length: 654
    SOAPAction: ""
    <?xml version="1.0" encoding="UTF-8" ?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema"><SOAP-ENV:Header><sapsess:Session xmlns:sapsess="http://www.sap.com/webas/630/soap/features/session/"><enableSession>true</enableSession></sapsess:Session></SOAP-ENV:Header><SOAP-ENV:Body><ns1:ZSRAV_TEST_CMS_BP_FAC xmlns:ns1='urn:sap-com:document:sap:rfc:functions'><IT_BP_LIST><item><BP_NUMBER>9999990013</BP_NUMBER></item></IT_BP_LIST><IV_COMPANY_CODE>FCC</IV_COMPANY_CODE></ns1:ZSRAV_TEST_CMS_BP_FAC></SOAP-ENV:Body></SOAP-ENV:Envelope>
    RESPONSE:
    HTTP/1.1 500 CX_ST_REF_ACCESS:XSLT exception.An error occurred during serialization in the simple transformation program /1BCDWB/WSSE2B50F3FDFC9C2A94B7.Access to the table ref. node 'ZSCMS_FAC_CAG_DETAILS' outside a loop
    Set-Cookie: <value is hidden>
    content-type: text/xml; charset=utf-8
    content-length: 0
    accept: text/xml
    sap-srt_id: 20100202/041112/v1.00_final_6.40/4B67E41A4BC41B7CE10000000A013104
    server: SAP Web Application Server (1.0;700)
    please do the needful.
    Thanks in advance

    Hi,
    Here is a very smart tool for webservice test:
    [soapUI|http://www.soapui.org/]
    It works fine for me!
    bg,
    attila

  • Using XSLT "adapter" for invoking a WS with SOAP-ENC array type param.

    Hello,
    I had to write a BPEL process that calls inside it a web service which has as an input an array parameter and as an output, also an array. I already know that BPEL has limitations regarding using the SOAP-ENC Array type. I tried to rewrite the web service in order to use a literal encoding of the array parameters (using "maxOccurs" attribute), but unfortunately, the OC4J container 9.0.4 that I have to use doesn't allow this. It only allows the SOAP-ENC types for array types.
    I started to write, inside the BPEL process, some "adapters" XSLT transformations before and after the invoking of the web service that uses SOAP-ENC array. The XSLT transformation before the web service invoking will translate the input array parameter defined with no SOAP encoding types (based on "maxOccurs" attribute) into a SOAP-ENC type, as it is expected by the web service. The XSLT transformation after the web service invoking will translate the returned array SOAP-ENC type into a data type defined with no SOAP encoding types (based on "maxOccurs" attribute).
    The approach is pretty hairy, from the XSLT point of view and it introduces a supplementary delay due to the XSLT processing needed, but it works. The only think is that when I build the service, I obtain the following error message:
    [bpelc] [Error] GCDBWebservice?WSDL:30:42: src-resolve.4.2: Error resolving component 'SOAP-ENC:Array'. It was detected that 'SOAP-ENC:Array' is in namespace 'http://schemas.xmlsoap.org/soap/encoding/', but components from this namespace are not referenceable from schema ...
    But in spite of this, the process is built and deployed successfully and I was able to run it from the BPEL console.
    Do you think that this approach could hide some other future problems that I can't see in this moment?
    Thanks,
    Marinel

    Please help me for this.
    I am new to Webservices and SOAP.
    I am facing problem when i am calling a "add" method in the .net webservices with the following code but it gives correct result when i'm calling the "HelloWorld" method present in the webservice.
    I think it will happening because, when i'm going to pass any parameter to the "add method , it does not process it.It will return me 0.
    Please help me in this.
    The code is:
    import java.io.*;
    import java.util.*;
    import java.net.*;
    import org.w3c.dom.*;
    import org.apache.soap.util.xml.*;
    import org.apache.soap.*;
    import org.apache.soap.encoding.*;
    import org.apache.soap.encoding.soapenc.*;
    import org.apache.soap.encoding.literalxml.*;
    import org.apache.soap.rpc.*;
    import org.apache.soap.transport.http.SOAPHTTPConnection;
    import org.apache.soap.transport.*;
    import org.apache.soap.messaging.*;
    import org.apache.xerces.parsers.*;
    import org.apache.xerces.dom.DocumentImpl;
    public class testClient {
    public static void main(String[] args) throws Exception {
    URL url = new URL ("http://Eurotele-it3/webService1/Service1.asmx");
    //Map the Types.
    SOAPMappingRegistry smr = new SOAPMappingRegistry ();
    StringDeserializer sd = new StringDeserializer ();
    smr.mapTypes(Constants.NS_URI_SOAP_ENC,new QName("http://Eurotele-it3/WebService1/Service1","addResult"),Integer.class,null,sd);
    // create the transport and set parameters
    SOAPHTTPConnection st = new SOAPHTTPConnection();
    // build the call.
    Call call = new Call();
    call.setSOAPTransport(st);
    call.setSOAPMappingRegistry(smr);
    call.setTargetObjectURI ("http://Eurotele-it3/WebService1/Service1/add");
    call.setMethodName("add");
    //call.setEncodingStyleURI("http://schemas.xmlsoap.org/soap/encoding/");
    call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
    Vector params = new Vector();
    params.addElement(new Parameter("x",Integer.class,"10",null));
    params.addElement(new Parameter("y",Integer.class,"20",null));
    call.setParams(params);
    Response resp = null;
    try {
    resp = call.invoke (url,"http://Eurotele-it3/WebService1/Service1/add");
    catch (SOAPException e) {
    System.err.println("Caught SOAPException (" + e.getFaultCode () + "): " +e.getMessage ());
    return;
    // check response
    if (resp != null && !resp.generatedFault()) {
    Parameter ret =resp.getReturnValue();
    Object value =ret.getValue();
    System.out.println ("Answer--> " +value );
    else {
    Fault fault = resp.getFault ();
    System.err.println ("Generated fault: ");
    System.out.println (" Fault Code = " + fault.getFaultCode());
    System.out.println (" Fault String = " + fault.getFaultString());
    This is the complete WSDL format:
    <?xml version="1.0" encoding="utf-8" ?>
    - <wsdl:definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://Eurotele-it3/WebService1/Service1" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" targetNamespace="http://Eurotele-it3/WebService1/Service1" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
    - <wsdl:types>
    - <s:schema elementFormDefault="qualified" targetNamespace="http://Eurotele-it3/WebService1/Service1">
    - <s:element name="HelloWorld">
    <s:complexType />
    </s:element>
    - <s:element name="HelloWorldResponse">
    - <s:complexType>
    - <s:sequence>
    <s:element minOccurs="1" maxOccurs="1" name="HelloWorldResult" type="s:int" />
    </s:sequence>
    </s:complexType>
    </s:element>
    - <s:element name="add">
    - <s:complexType>
    - <s:sequence>
    <s:element minOccurs="1" maxOccurs="1" name="x" type="s:int" />
    <s:element minOccurs="1" maxOccurs="1" name="y" type="s:int" />
    </s:sequence>
    </s:complexType>
    </s:element>
    - <s:element name="addResponse">
    - <s:complexType>
    - <s:sequence>
    <s:element minOccurs="1" maxOccurs="1" name="addResult" type="s:int" />
    </s:sequence>
    </s:complexType>
    </s:element>
    </s:schema>
    </wsdl:types>
    - <wsdl:message name="HelloWorldSoapIn">
    <wsdl:part name="parameters" element="tns:HelloWorld" />
    </wsdl:message>
    - <wsdl:message name="HelloWorldSoapOut">
    <wsdl:part name="parameters" element="tns:HelloWorldResponse" />
    </wsdl:message>
    - <wsdl:message name="addSoapIn">
    <wsdl:part name="parameters" element="tns:add" />
    </wsdl:message>
    - <wsdl:message name="addSoapOut">
    <wsdl:part name="parameters" element="tns:addResponse" />
    </wsdl:message>
    - <wsdl:portType name="Service1Soap">
    - <wsdl:operation name="HelloWorld">
    <wsdl:input message="tns:HelloWorldSoapIn" />
    <wsdl:output message="tns:HelloWorldSoapOut" />
    </wsdl:operation>
    - <wsdl:operation name="add">
    <wsdl:input message="tns:addSoapIn" />
    <wsdl:output message="tns:addSoapOut" />
    </wsdl:operation>
    </wsdl:portType>
    - <wsdl:binding name="Service1Soap" type="tns:Service1Soap">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
    - <wsdl:operation name="HelloWorld">
    <soap:operation soapAction="http://Eurotele-it3/WebService1/Service1/HelloWorld" style="document" />
    - <wsdl:input>
    <soap:body use="literal" />
    </wsdl:input>
    - <wsdl:output>
    <soap:body use="literal" />
    </wsdl:output>
    </wsdl:operation>
    - <wsdl:operation name="add">
    <soap:operation soapAction="http://Eurotele-it3/WebService1/Service1/add" style="document" />
    - <wsdl:input>
    <soap:body use="literal" />
    </wsdl:input>
    - <wsdl:output>
    <soap:body use="literal" />
    </wsdl:output>
    </wsdl:operation>
    </wsdl:binding>
    - <wsdl:service name="Service1">
    <documentation xmlns="http://schemas.xmlsoap.org/wsdl/" />
    - <wsdl:port name="Service1Soap" binding="tns:Service1Soap">
    <soap:address location="http://eurotele-it3/webService1/Service1.asmx" />
    </wsdl:port>
    </wsdl:service>
    </wsdl:definitions>

  • R/3- PI- webservice. Pass userid/password for Username Token from R/3

    Hello,
    We (SAP R/3) need to call Webservices from third party for which we are using SAP-PI system as the Middleware.
    The Password and ID for USERNAME TOKEN to be passed in the SOAP Header request needs to be sent through RFC in SAP R/3.
    The requirement is that SAP-PI should use this ID/password and prepare the USername Token in the SOAP Request header for the Webservice Call.
    Note: PI has AXIS framework installed on it.
    Can you please suggest as to what should be done? Request you to please provide the Custom Code / Detailed configuration etc. that is required to be done at the PI end.
    Note: I have searched the Forum but couldn't find anything a detailed information.
    Thanks & Regards,
    Abhishek Jolly

    XSLT-Mapping looks like this:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="xml" indent="yes"/>
    <xsl:template match="/">
       <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:wsh="http://something/wsh">
         <soapenv:Header>
           <wsh:Context>
           <SessionId>
             <xsl:value-of select="/*[local-name()
    =MySoapFunction]/Parameters/Parameters
    [Scope[text()='XI'] and Name[text()='SessionID']]/Value"/>
          </SessionId>
         </wsh:Context>
        </soapenv:Header>
        <soapenv:Body>
         <wsh:MySoapFunction>
          <xsl:if test="count(./*[local-name()=MySoapFunction]/Parameters/Parameters)>1">
           <Parameters>
             <xsl:for-each select="./*[local-name()=MySoapFunction]/Parameters/Parameters">
               <xsl:if test="Scope!='XI'">
                 <Parameters>
                   <Scope><xsl:value-of select="Scope"/></Scope>
                   <Name><xsl:value-of select="Name"/></Name>
                   <Value><xsl:value-of select="Value"/></Value>
                  </Parameters>
                 </xsl:if>
               </xsl:for-each>
              </Parameters>
             </xsl:if>
           </wsh:MySoapFunction>
          </soapenv:Body>
    </soapenv:Envelope>
    I save XSLT to file.
    Input message that creates in XI and live only in BPM:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MySoapFunction xmlns:ns0="http://something/wsh">
        <Parameters>
            <Parameters>
                <Scope>XI</Scope>
                <Name>SessionID</Name>
                <Value>0123456789</Value>
                </Parameters>
            <Parameters>
                <Scope>otherScope</Scope>
                <Name>someParam</Name>
                <Value>someValue</Value>
             </Parameters>
        </Parameters>
    </ns0:MySoapFunction>
    In BPM's SendStep this message is used.
    2) Create ZIP archive with this XSLT file (one archive can contains many XSLT programs). And Import ZIP it into XI. You can see this in Imported Archive and list of filenames of Archived Program in XI.

  • Split an XML File and invoke a Web Serivce for each splits using an  XSLT

    Hi,
    We Have a requirement to Split an incoming XML File into chunks based on a child element and hit the target Web Service for each and every split ( i.e no of splits = no of hits on WebService).
    Currently, the incoming XML file is getting splitted and gets appended to the SAME Payload and the WebService is hitted only once with the entire Payload.
    Is it possible to invoke a WebService within a XSLT ?
    Please find below the XSLT code used to split the file in chunks of 3
    <xsl:param name="pItemsNumber" select="3"/>
    <xsl:template match="@*|node()">
    <xsl:choose>
    <xsl:when test="count(Batch/Item) > 4">
    <ItemMaintenance>
    <xsl:for-each-group select="Batch/Item"
    group-adjacent="(position()-1) idiv $pItemsNumber">
    <xsl:result-document href="ItemsMatch\{current-grouping-key()}.xml">
    <ItemMaintenance>
    <xsl:copy-of select="current-group()"/>
    </ItemMaintenance>
    </xsl:result-document>
    </xsl:for-each-group>
    </ItemMaintenance>
    </xsl:when>
    <xsl:otherwise>
    <xsl:copy>
    <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
    </xsl:otherwise>
    </xsl:choose>
    </xsl:template>

    Hello,
    It is possible to invoke a webservice from XSLT. To achieve this you must create a custom XSLT function that does the actual webservice call. You need to write an implementation in Java for this. See my blogpost http://blog.melvinvdkuijl.nl/2010/02/custom-xslt-functions-in-oracle-soa-suite-11g/ for a simple example.
    Regards,
    Melvin

  • XSLT-transformation in Java-Mapping with javax.xml

    Hi,
    we wanna use javax.xml for transformations in Java-Mapping.
    Inside the Java-mapping we read in XSL-files to transform a XML-stream. With XSLT 1.0 everything works fine - but with XSLT 2.0 we are getting runtime errors.
    Is it possible that javax.xml only supports XSLT 1.0?
    Regards
    Wolfgang

    Hi ,
    Jaxp 1.3 is available in this link -
    http://java.sun.com/webservices/jaxp/
    Use these jar files to process XSLT 2.0.
    Nanda

  • CX_SY_CONVERSION_NO_DATE_TIME XSLT Exception

    Hi,
    we're running ECC6.0 and created a Web Service(WS) out of a SAP-Function Module(FM).
    When calling this WS from Excel-VBA (XP; WS-Toolkit) the following error pops up:
    CX_SY_CONVERSION_NO_DATE_TIME: XSLT Exception An Error occured while deserialization in ST-program /1BCDWB/WSSA..............
    The value 4/6/2009 is not a valid date regarding XML-format for ABAP.
    (this is my translation from original german error message, so english error message may differ a bit).
    For explanation:
    The FM/WS should give me a table with fields of type DATS and I think the single transformation cannot convert 20090604 to 2009-06-04 but only to 4/6/2009.
    Any ideas would be great....

    Thanks for your feedback, Ralph.
    But, let me tell you that I tried again using a test tool for WebServices (soapUI 3.0.1, free software) and I got surprised to see that everything worked OK!, without errors (I had to previously clear "?" symbols and others "rare" values that the tool filled in for some parameters, nothing important).
    All of the Date fields were transfered to the BAPI, according to xml format for dates: "YYYY-MM-DD".
    So, I was able to avoid this "issue" by now, but I'm not sure what will happen until the real legacy sistem starts its owns tests.
    I have to wait until that moment to be sure. But according to test tool soapUI, if you use that format, it should work (I'm using SAP ECC 6.0). Let's see what happens in the end.
    May be there is some configuration or setting issue in the external/legacy system that calls your WebService.
    Regards,
    JG.

  • Xslt code to replace a node name to include ns0 prefix

    Hi,
    Is there some easy xslt code to change the following: (I want the ns0 tag and namespace introduced in the root node so that my mapping works. I have created the mapping using externally provided wsdl, but the input message expects the prefix ns0 whereas the message coming to me from third party does not have the prefix. So in order to force it through the mapping I am thinking of using xslt to translate <createOrUpdateJobsResponse> to <ns0:createOrUpdateJobsResponse xmlns:ns0="http://service.webservice.xxxxxxxx.com"> and the closing tag </createOrUpdateJobsResponse> to </ns0:createOrUpdateJobsResponse>.
    Source:
    <?xml version="1.0" encoding="UTF-8"?>
    <createOrUpdateJobsResponse>
       <createOrUpdateJobsReturn>
          <errorCode/>
          <errorMessage/>
          <goodResult/>
          <jobReferenceNumber/>
       </createOrUpdateJobsReturn>
    </createOrUpdateJobsResponse>
    Target:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:createOrUpdateJobsResponse xmlns:ns0="http://service.webservice.xxxxxxxx.com">
       <createOrUpdateJobsReturn>
          <errorCode/>
          <errorMessage/>
          <goodResult/>
          <jobReferenceNumber/>
       </createOrUpdateJobsReturn>
    </ns0:createOrUpdateJobsResponse>

    Hi James,
    You could give a try with this :
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns0="http://service.webservice.xxxxxxxx.com" version="1.0">
         <xsl:output indent="yes" omit-xml-declaration="no"/>
         <xsl:template match="/">
              <ns0:createOrUpdateJobsResponse>
                   <xsl:apply-templates/>
              </ns0:createOrUpdateJobsResponse>
         </xsl:template>
         <xsl:template match="createOrUpdateJobsReturn">
              <xsl:copy-of select="."/>
         </xsl:template>
    </xsl:stylesheet>
    It should recreate the same msg structure with a ns0 namespace for the output document
    Rgds
    Chris

  • Problem in transforming XML to string using XSLT

    Hi there,
    I have a R/3 -> XI -> WebService scenario where the message from XI to webservice needs to be sent in document/wrapped mode (the message xml must be embedded in a string element) and this message needs to be digitally signed.
    We are using another webservice to sign the messages, also with the message being sent in a string. To transform the XML's into string and vice-versa, we are using XSLT (/people/michal.krawczyk2/blog/2005/11/01/xi-xml-node-into-a-string-with-graphical-mapping).
    The problem is that both the signer and the final webservice understand the special characters (like '<', '>', '&', '"' etc) in one way but the XSLT generates them in another way. For example, the character '<', in both webservices, is returned as "&#60;" but the XSL Transformation results in "&lt;".
    The problem now is that our messages are always being rejected because the signature is not being recognized as true, though we are almost 100% sure that it's being done correctly. The only possibility to the error that we found is this character mapping being done differently.
    So, it's like this:
    XI sends string to signer as "&lt;"
    XI receives string from signer as "&#60;"
    XI processes the message
    XI sends string to webservice as "&lt;"
    XI receives string from webservice (containing error message) as "&#60;"
    Is there a way of making the XSLT to return "&#60;" instead of "&lt;"?
    Thanks in advace,
    Henrique.

    For Java Mapping, you can refer this-
    /people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-i
    /people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-ii
    /people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-iii
    In Java Mapping, in the startdocument event , you need to check for the specialchars, and just repalce the value required.
    But, what i am thinking is , just try with Java functions inside the XSLT mapping instead of going for Java Mapping. You can call java functions from the XSLT. So before the document starts pasring, you need to replace the special characters. I did not try in XSLT like this.
    For this , you can think with this e.g
    /people/pooja.pandey/blog/2005/06/27/xslt-mapping-with-java-enhancement-for-beginners
    Regards,
    Moorthy

  • Webservice error......

    Hi,
    I am getting the below error when i am calling webservice from SOAP UI client, i have authorization of SAP_ALL and SAP_NEW.
    Your help would be appreciated.
    Thanks in advance.
    <soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
       <soap-env:Header/>
       <soap-env:Body>
          <soap-env:Fault>
             <faultcode>soap-env:Server</faultcode>
             <faultstring xml:lang="en">CX_SY_CONVERSION_NO_DATE_TIME:XSLT exception.An error occurred when deserializing in the simple transformation program /1BCDWB/WSS0060807205412435000.Value  is not a valid date in accord with the XML format for ABAP</faultstring>
             <detail>
                <ns:SystemFault xmlns:ns="http://www.sap.com/webas/710/soap/runtime/abap/fault/system/">
                   <Host>undefined</Host>
                   <Component>APPL</Component>
                   <ChainedException>
                      <Exception_Name>CX_SOAP_CORE</Exception_Name>
                      <Exception_Text>CX_SY_CONVERSION_NO_DATE_TIME:XSLT exception.An error occurred when deserializing in the simple transformation program /1BCDWB/WSS0060807205412435000.Value  is not a valid date in accord with the XML format for ABAP</Exception_Text>
                   </ChainedException>
                   <ChainedException>
                      <Exception_Name>CX_SXMLP</Exception_Name>
                      <Exception_Text>XSLT exception</Exception_Text>
                   </ChainedException>
                   <ChainedException>
                      <Exception_Name>CX_ST_DESERIALIZATION_ERROR</Exception_Name>
                      <Exception_Text>An error occurred when deserializing in the simple transformation program /1BCDWB/WSS0060807205412435000: Main Program:/1BCDWB/WSS0060807205412435000| Program:/1BCDWB/WSS0060807205412435000| Line: 25| Valid:X</Exception_Text>
                   </ChainedException>
                   <ChainedException>
                      <Exception_Name>CX_SY_CONVERSION_NO_DATE_TIME</Exception_Name>
                      <Exception_Text>Value  is not a valid date in accord with the XML format for ABAP</Exception_Text>
                   </ChainedException>
                </ns:SystemFault>
             </detail>
          </soap-env:Fault>
       </soap-env:Body>
    </soap-env:Envelope>

    Hi Ashok,
                  looks like there is a mismatch in the Date and Time format being used by the server side program and the payload you are sending via SOAP UI client. To make sure that there is a consistency in the format please check the standard format for Date/Time in XML standards.
    Given below is a reference:
    http://www.w3schools.com/Schema/schema_dtypes_date.asp
    In short the Date-Time should be specified in UTC format as 'YYYY-MM-DDThh:mm:ss' where
    YYYY - indicates the year
    MM -  indicates the month
    DD - indicates the day
    T - indicates the start of the required time section
    hh - indicates the hour
    mm - indicates the minute
    ss - indicates the second
    There are certain variations to specify the Time zones etc. The details you can find in the above link or by googling "UTC time format".
    Please do get back if you still didn't get it solved.
    Regards
    Barada.

  • CX_ST_GROUP_MISSING_CASE:XSLT Exception offset 409 - what does it mean ?

    Hello,
    a webservice consumer-proxy does'nt work fine and I have no idea, what's wrong.
    In SOAMANAGER I checked the tracefiles and a lot of errors occurs:
    "CX_ST_GROUP_MISSING_CASE:XSLT Exception bei Offset 409, XPath n0...Element id fehlt (fault location is 1 )"
    What does it mean ?
    Problems with element 'id' , but what exactly ?
    The response contained element 'id'  but with value zero.
    <soapenv:Body>
    <createDeliveryNoteResponse xmlns="http://ws.common">
    <createDeliveryNoteReturn>
    <id>0</id>
    </createDeliveryNoteReturn>
    </createDeliveryNoteResponse>
    </soapenv:Body>
    </soapenv:Envelope>
    thanks in advance.
    best regards
    Holger
    - <
    <

    Hello,
    problem is solved.
    What's the reason for this ?
    Exception CX_ST_GROUP_MISSING_CASE is not correct, the transformation works fine, with STRANS you can check this.
    But in SE80 you can check the client-proxy with the definition of wsdl and any objects are missing or must change. Why I have no idea, it seems like a bug after implementation support packages.
    So after generating missing objects and activating the webservice works fine, no exception occurs.
    best regards
    Holger

  • XI SOAP adapter vs webservice testing tools

    Actually I have creted simple xslt mapping and managed to come up with exactly in the format of endpoint request format of the webservice.
    here is the payload( I have created the SOAP Envelop, Header and body in the payload)
    <?xml version="1.0" encoding="utf-8"?>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:eb="http://www.ebxml.org/namespaces/messageHeader" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsd="http://www.w3.org/1999/XMLSchema">
      <SOAP-ENV:Header>
        <eb:MessageHeader SOAP-ENV:mustUnderstand="1" eb:version="1.0">
          <eb:ConversationId>sucesss</eb:ConversationId>
          <eb:From>
            <eb:PartyId type="urn:x12.org:IO5:01">applevac.com</eb:PartyId>
          </eb:From>
          <eb:To>
            <eb:PartyId type="urn:x12.org:IO5:01">webservices.sabre.com</eb:PartyId>
          </eb:To>
          <eb:CPAId>P4XC</eb:CPAId>
          <eb:Service eb:type="sabreXML">session</eb:Service>
          <eb:Action>SessionCreateRQ</eb:Action>
          <eb:MessageData>
            <eb:MessageId>mid:[email protected]</eb:MessageId>
            <eb:Timestamp>2001-02-15T11:15:12Z</eb:Timestamp>
            <eb:TimeToLive>2001-02-15T11:15:12Z</eb:TimeToLive>
          </eb:MessageData>
        </eb:MessageHeader>
        <wsse:Security xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext" xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/12/utility">
          <wsse:UsernameToken>
            <wsse:Username>5555</wsse:Username>
            <wsse:Password>password</wsse:Password>
            <Organization>L5x5</Organization>
            <Domain>DEFAULT</Domain>
          </wsse:UsernameToken>
        </wsse:Security>
      </SOAP-ENV:Header>
      <SOAP-ENV:Body>
        <eb:Manifest SOAP-ENV:mustUnderstand="1" eb:version="1.0">
          <SessionCreateRQ>
            <POS>
              <Source PseudoCityCode="P4XC"/>
            </POS>
          </SessionCreateRQ>
        </eb:Manifest>
      </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    I want XI to post just the payload and nothing else so....
    I selected Do not use envelope in the adapter configuration because we have every thing( SOAP envelop, header and body in the payload) but it is not working as i am still getting the same error message before implementing this xslt.
    Error Message:
    <StackTrace>com.sabre.universalservices.base.session.SessionException: errors.session.USG_CONVERSATION_ID_REQUIRED at com.sabre.universalservices.gateway.control.SecurityInterceptor.executeOnRequest(SecurityInterceptor.java:116) at com.sabre.universalservices.base.interceptor.Interceptor.execute(Interceptor.java:113) at com.sabre.universalservices.base.interceptor.InterceptorChain.applyInterceptors(InterceptorChain.java:32) at com.sabre.universalservices.base.interceptor.InterceptorManager.process(InterceptorManager.java:121) at com.sabre.universalservices.gateway.control.WSGateway.onMessage(WSGateway.java:415) at com.sabre.universalservices.gateway.control.WSGateway.handleRequest(WSGateway.java:313) at com.sabre.universalservices.gateway.control.WSGateway.doPost(WSGateway.java:247) at javax.servlet.http.HttpServlet.service(HttpServlet.java:709) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
    Do you have any idea like XI will add anything to this pay load when it sends out to the webservice?
    If i take the payload from the XI and try it in SOAPUI(tool to test webservice, you would know it already ) it works fine, I mean I was able to get the proper response but in XI it does not work.
    Any help in this regards is highly appreciated.
    we are using PI 7.0 and SP 9.
    Message was edited by:
            Venkat Marni
    Message was edited by:
            Venkat Marni

    Hi,
    Finally I could solve the problem.
    I was actually trying to post the information from the http client at the sender and receiver side I am getting the error.
    Later i have actually created the webservice for my sender interface in XI then post the info using the SOAPUI(3rd party tool) to post the info to XI and then Xi will communicate the webservice using SOAP adapter then I got the proper response from the webservice.
    In this whole episode I guess there is some thing wrong in using a htp client but technically we should be able to use http client as XI will take the payload and use xslt mapping to come up with target interface soap message( but i do not know why XI failed in that).
    thanks for all your help and hope this is clear.
    thanks,
    Venkat

Maybe you are looking for

  • Use of t-code SE14

    Hi Gurus Would anybody pl brief me about the use of SE14 trasaction? I would appreciate if anybody can give me some detail direction as when can we use this t-code ? Thanks

  • Update XML using DOM parser

    I am using Dom parser in java to parse xml.I am able to retrive data from xml.Can any one help me in updating an xml when data is modified in the user interface.I am created interface in html with three fields namely UserName , LastLogin, Modified fi

  • Hosting a Website made in Adobe Muse

    Hello! So, I'm designing my first website for a client and I have some doubts. I want to finish the website and then send the files to him so he can host it with some third party program (he doesn't use Muse) Is that possible? If so, what files shoul

  • Doc lit wrapped

    Hi, i've created a doc lit wrapped web service and i use JAXB. But JAXB creates java classes for the wrapper classes, which is not wanted (Axis 1 for example doesn't create the wrapper classes if the wsdl is wrapped compatible). How can i avoid creat

  • Can't locate my photo booth

    I guess I accidently deleted my photo booth and would like to know how I can get it back.