Hi Remsy

You can do a simple xslt transformation using xslt script like as bellow



xsl:stylesheet version="2.0"

           xmlns:xsl="http://www.w3.org/1999/XSL/Transform";

           xmlns:fn="http://www.w3.org/2005/02/xpath-functions";

           xmlns:m0="http://ws.apache.org/commons/ns/payload";

           exclude-result-prefixes="m0 fn">

<xsl:output method="xml" omit-xml-declaration="yes" indent="yes"/>



<xsl:template match="/">

 <xsl:apply-templates select="//m0:text" />

</xsl:template>



<xsl:template match="m0:text">



<ws:processMessage xmlns:ws="http://ws.remsy.ca/";>

           <ws:msgIn>

          <xsl:value-of select="."/>

   </ws:msgIn>

</ws:processMessage>



</xsl:template>

</xsl:stylesheet>





And thing you need to know, it is possible to change the wrapping outer element name adding parameter to service ( or proxy service) which used to listen JMS ,Mail , VFS .



<parameter name="Wrapper">{namespace URI}wrapper element name</parameter>

For example:

<parameter name="Wrapper">{http://services.samples <http://services.samples>}getQuote</parameter>

Sample 252 uses demonstrates this

And simple custom mediator that deals with payload too work for you.


Thanks
Indika




Schmilinsky, Remsy wrote:
Here is another sample, obtained from SoapUI tool:

POST http://localhost:9080/testWS/services/Test HTTP/1.1
Content-Type: text/xml;charset=UTF-8
SOAPAction: ""
User-Agent: Jakarta Commons-HttpClient/3.1
Host: localhost:9080
Content-Length: 275

<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:ws="http://ws.remsy.ca";>
   <soapenv:Header/>
   <soapenv:Body>
      <ws:processMessage>
         <ws:msgIn>message text</ws:msgIn>
      </ws:processMessage>
   </soapenv:Body>
</soapenv:Envelope>

Where "message text" comes from JMS, so how can I modify the message
context to construct a request like this to the soap endpoint? Need to
add any parameters?
Thanks

Remsy

-----Original Message-----
From: Schmilinsky, Remsy Sent: December 22, 2008 10:14 AM
To: '[email protected]'
Subject: RE: [esb-java-user] invoking websphere service

Hi Paul, the request should look like this:

<?xml version="1.0" encoding="UTF-8" ?> <soapenv:Envelope xmlns:q0="http://ws.remsy.ca";
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
<soapenv:Body>
<q0:processMessage>
<msgIn>some text...</msgIn> </q0:processMessage>
</soapenv:Body>
</soapenv:Envelope>


-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Paul Fremantle
Sent: December 19, 2008 10:28 AM
To: [email protected]
Subject: Re: [esb-java-user] invoking websphere service

Remsy

It looks like you are trying to link an ESB file or JMS text service with a WSDL defined endpoint.

When you read files, JMS or other non-XML data into the ESB we logically

create a SOAP envelope to handle that data. Usually that never leaves the ESB, because typically you would either transform it into XML or store it in another file. But you are sending it on to a Web Service, which is expecting some other XML format. You need to transform this using a mediator or E4X, XSL etc.

If you give me some better ideas about what you are doing I can maybe help some more.

Paul

Schmilinsky, Remsy wrote:
Hi, I have an endpoint with a simple web service deployed on
websphere.
I get a soap fault saying "Could not resolve to an operation.  The
message contains an element named
""{http://ws.apache.org/commons/ns/payload}text"";, but this does not
match any operation of the target port.

Endpoint is configured like this:

<syn:endpoint name="testWS">
        <syn:address uri="http://localhost:9080/testWS/services/Test";
format="soap11">
            <enableAddressing/>
        </syn:address>
</syn:endpoint>

Do you know how to resolve this? Below is the full response:

<?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";

xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/";><soapenv:Body>
<soapenv:Fault><faultcode>soapenv:Client</faultcode><faultstring>WSWS327
7E: Error: Could not resolve to an operation.  The message contains an
element named ""{http://ws.apache.org/commons/ns/payload}text"";, but
this does not match any operation of the target port. Debug: name:
services/Test
implClass:       class ca.remsy.test.Test
implClassLoader: com.ibm.ws.classloader.compoundclassloa...@6b1c6b1c
   Local ClassPath: C:\Documents and

Settings\remsy\IBM\rationalsdp7.0\workspace\testWS\WebContent\WEB-INF\cl
asses;C:\Documents and
Settings\remsy\IBM\rationalsdp7.0\workspace\testWS\WebContent
   Delegation Mode: PARENT_FIRST
defaultNS:       null
endpointURL:     null
 OperationDesc[0]:
  name:        processMessage
  returnQName: processMessageReturn
  returnType:  {http://www.w3.org/2001/XMLSchema}string
  returnClass: class java.lang.String
  elementQName:{http://test.remsy.ca}processMessage
  soapAction:  processMessage
  style:       wrapped
  use:         literal
  numInParams: 1
properties: KEY(ResponseNamespace)
    VALUE(http://test.remsy.ca)
   KEY(ResponseLocalPart)
    VALUE(processMessageResponse)
   KEY(buildNum)
    VALUE(cf90721.10)
   KEY(ServiceQName)
    VALUE({http://test.remsy.ca}TestService)
   KEY(portTypeQName)
    VALUE({http://test.remsy.ca}Test)
   KEY(outputName)
    VALUE(processMessageResponse)
   KEY(inputMessageQName)
    VALUE({http://test.remsy.ca}processMessageRequest)
   KEY(outputMessageQName)
    VALUE({http://test.remsy.ca}processMessageResponse)
   KEY(usingAddressing)
    VALUE(false)
   KEY(inputName)
    VALUE(processMessageRequest)
   KEY(targetNamespace)
    VALUE(http://test.remsy.ca)
  method:public java.lang.String
ca.remsy.test.Test.processMessage(java.lang.String)
   ParameterDesc[0]:
    identity:
com.ibm.ws.webservices.engine.description.parameterd...@cec0cec
  name:       msg
  mode:       IN
  isReturn:   false
  typeQName:  {http://www.w3.org/2001/XMLSchema}string
  javaType:   class java.lang.String
  javaSigType:class java.lang.String
  inHeader:   false
  outHeader:  false
  minOccursIs0:false
  maxOccursIs1:true
properties: KEY(partName)
    VALUE(string)
   KEY(partQNameString)
    VALUE({http://www.w3.org/2001/XMLSchema}string)


</faultstring></soapenv:Fault></soapenv:Body></soapenv:Envelope>



_______________________________________________
Esb-java-user mailing list
[email protected]
https://wso2.org/cgi-bin/mailman/listinfo/esb-java-user


------------------------------------------------------------------------


No virus found in this incoming message.
Checked by AVG - http://www.avg.com Version: 8.0.176 / Virus Database: 270.10.0/1861 - Release Date: 12/22/2008 11:23 AM


_______________________________________________
Esb-java-user mailing list
[email protected]
https://wso2.org/cgi-bin/mailman/listinfo/esb-java-user

Reply via email to