gsoap error : :ClientValidation constraint violation: invalid value in element - wsdl

Whenever I try to execute a service getContractHdr using online test tools like :
http://www.soapclient.com/soaptest.html
I get the error listed below. The type (of inTENANTREFNO ) is an INTEGER. Even when I place something like 33 in for the field inTENANTREFNO, I still get the error of "type mismatch". Additionally, the message states that the variable inTENANTREFNO is associated with the namespace of am but I do not see why gsoap is making this assignment.
Question
How can I fix this so that I no longer get the error? Is there a way to
configure this so that the namespaces are not used at all? Why am I
getting
it in the first place? I have seen this message here but it is not clear
as to whether or not implementing this would resolve the problem in
this case
Note: All works fine whenever I use the sample generated .xml files. I fill out the fields of course.The service runs and I get data (correct) back. I execute it with "ServerName < testfile.xml"
When I attempt to execute the service from one of the online testing areas (as mentioned above). It does not work citing a "type mismatch".
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:ns="urn:conmony">
<SOAP-ENV:Body>
<ns:getContractHdr>
<ns:inLogonID></ns:inLogonID>
<ns:inLogonPassword></ns:inLogonPassword>
<ns:inTENANTREFNO>0</ns:inTENANTREFNO>
<ns:incallhost></ns:incallhost>
<ns:incallpid>0</ns:incallpid>
<ns:incallfilename></ns:incallfilename>
<ns:incalllineno>0</ns:incalllineno>
</ns:getContractHdr>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Error message
SOAP-ENV:ClientValidation constraint violation: invalid value in
element 'am:inTENANTREFNO'
Error Message With SOAP Fault
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:am="urn:conmony" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>SOAP-ENV:Client</faultcode>
<faultstring>Validation constraint violation: invalid value in element 'am:inTENANTREFNO'</faultstring>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Ran soapcpp2 -c -n -pdukmony - AND - soapcpp2 -c on a file with the contents below
//gsoap am service name: conmony
//gsoap am service style: document
//gsoap am service encoding: literal
//gsoap am service location: http://99.33.23.2232:8075
//gsoap am schema namespace: urn:conmony
typedef char *xsd__string;
typedef char *xsd__anyURI;
typedef float xsd__float;
typedef long xsd__int;
typedef double xsd__double;
typedef unsigned long long xsd__positiveInteger;
typedef struct am__struct_DBCONTRACTHDR{
xsd__int TENANTREFNO;
xsd__string FirstName;
xsd__string MiddleName;
xsd__string LastName;
xsd__string EMail;
xsd__string CellPhoneNo;
xsd__string HomePhoneNo;
xsd__string AsgnLogonID;
xsd__string WebPicLocation;
xsd__int ReturnCode;
xsd__double KeyID;
xsd__string Message; };
typedef struct am__CONTRACTHDRItems {
struct am__struct_DBCONTRACTHDR *__ptr;
int __size;
int __offset; };
inTENANTREFNO
int am__getContractHdr(
xsd__int inTENANTREFNO,
xsd__string inLogonID,
xsd__string inLogonPassword,
xsd__string incallhost,
xsd__int incallpid,
xsd__string incallfilename,
xsd__int incalllineno,
struct am__CONTRACTHDRItems *DBListing);
The result is the conmony.wsdl file
<definitions xmlns:tns="urn:conmony/conmony.wsdl" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:am="urn:conmony" xmlns:SOAP="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:HTTP="http://schemas.xmlsoap.org/wsdl/http/" xmlns:MIME="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:DIME="http://schemas.xmlsoap.org/ws/2002/04/dime/wsdl/" xmlns:WSDL="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/" name="conmony" targetNamespace="urn:conmony/conmony.wsdl">
<types>
<schema xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:am="urn:conmony" xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:conmony" elementFormDefault="qualified" attributeFormDefault="unqualified">
<import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
<complexType name="struct-DBCONTRACTHDR">
<!-- am__struct_DBCONTRACTHDR -->
<sequence>
<element name="TENANTREFNO" type="xsd:int" minOccurs="1" maxOccurs="1"/>
<!-- am__struct_DBCONTRACTHDR::TENANTREFNO -->
<element name="FirstName" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/>
<!-- am__struct_DBCONTRACTHDR::FirstName -->
<element name="MiddleName" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/>
<!-- am__struct_DBCONTRACTHDR::MiddleName -->
<element name="LastName" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/>
<!-- am__struct_DBCONTRACTHDR::LastName -->
<element name="EMail" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/>
<!-- am__struct_DBCONTRACTHDR::EMail -->
<element name="CellPhoneNo" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/>
<!-- am__struct_DBCONTRACTHDR::CellPhoneNo -->
<element name="HomePhoneNo" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/>
<!-- am__struct_DBCONTRACTHDR::HomePhoneNo -->
<element name="AsgnLogonID" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/>
<!-- am__struct_DBCONTRACTHDR::AsgnLogonID -->
<element name="WebPicLocation" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/>
<!-- am__struct_DBCONTRACTHDR::WebPicLocation -->
<element name="ReturnCode" type="xsd:int" minOccurs="1" maxOccurs="1"/>
<!-- am__struct_DBCONTRACTHDR::ReturnCode -->
<element name="KeyID" type="xsd:double" minOccurs="1" maxOccurs="1"/>
<!-- am__struct_DBCONTRACTHDR::KeyID -->
<element name="Message" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/>
<!-- am__struct_DBCONTRACTHDR::Message -->
</sequence>
</complexType>
<complexType name="CONTRACTHDRItems">
<!-- am__CONTRACTHDRItems -->
<sequence>
<element name="item" type="am:struct-DBCONTRACTHDR" minOccurs="0" maxOccurs="unbounded" nillable="false"/>
</sequence>
</complexType>
<!-- operation request element -->
<element name="getContractHdr">
<complexType>
<sequence>
<element name="inTENANTREFNO" type="xsd:int" minOccurs="1" maxOccurs="1"/>
<!-- am__getContractHdr::inTENANTREFNO -->
<element name="inLogonID" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/>
<!-- am__getContractHdr::inLogonID -->
<element name="inLogonPassword" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/>
<!-- am__getContractHdr::inLogonPassword -->
<element name="incallhost" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/>
<!-- am__getContractHdr::incallhost -->
<element name="incallpid" type="xsd:int" minOccurs="1" maxOccurs="1"/>
<!-- am__getContractHdr::incallpid -->
<element name="incallfilename" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/>
<!-- am__getContractHdr::incallfilename -->
<element name="incalllineno" type="xsd:int" minOccurs="1" maxOccurs="1"/>
<!-- am__getContractHdr::incalllineno -->
</sequence>
</complexType>
</element>
<!-- operation response element -->
<element name="getContractHdrResponse">
<complexType>
<sequence>
<element name="DBListing" type="am:CONTRACTHDRItems" minOccurs="0" maxOccurs="1" nillable="true"/>
<!-- am__getContractHdr::DBListing -->
</sequence>
</complexType>
</element>
</schema>
</types>
<message name="getContractHdrRequest">
<part name="Body" element="am:getContractHdr"/>
<!-- am__getContractHdr::am__getContractHdr -->
</message>
<message name="getContractHdrResponse">
<part name="Body" element="am:getContractHdrResponse"/>
</message>
<portType name="conmonyPortType">
<operation name="getContractHdr">
<documentation>Service definition of function am__getContractHdr</documentation>
<input message="tns:getContractHdrRequest"/>
<output message="tns:getContractHdrResponse"/>
</operation>
</portType>
<binding name="conmony" type="tns:conmonyPortType">
<SOAP:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="getContractHdr">
<SOAP:operation soapAction=""/>
<input>
<SOAP:body parts="Body" use="literal"/>
</input>
<output>
<SOAP:body parts="Body" use="literal"/>
</output>
</operation>
</binding>
<service name="conmony">
<documentation>gSOAP 2.8.26 generated service definition</documentation>
<port name="conmony" binding="tns:conmony">
<SOAP:address location="http://99.33.23.2232:8075"/>
</port>
</service>
</definitions>
UPDATE:
Changed header portion of file that soapcpp2 is ran upon to:
//gsoap ns service name: conmony Special SOAP SErvices
//gsoap ns service protocol: SOAP
//gsoap ns service style: document
//gsoap ns service encoding: literal
//gsoap ns service namespace: http://99.33.23.2232:8075?conmony.wsdl
//gsoap ns service location: http://99.33.23.2232:8075
//gsoap ns schema namespace: urn:conmony
and still got the same issue
But still getting data when filling out the sample req.xml files generated
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns="urn:conmony"><SOAP-ENV:Body><ns:getContractHdrResponse><ns:DBListing><ns:item><ns:TENANTREFNO>8288</ns:TENANTREFNO><ns:FirstName>Test</ns:FirstName><ns:MiddleName></ns:MiddleName><ns:LastName>Last</ns:LastName><ns:EMail>testing#last.com</ns:EMail><ns:CellPhoneNo>210-444-2212</ns:CellPhoneNo><ns:HomePhoneNo>210-444-2212</ns:HomePhoneNo><ns:AsgnLogonID>w10testing</ns:AsgnLogonID><ns:WebPicLocation>stuff</ns:WebPicLocation><ns:ReturnCode>0</ns:ReturnCode><ns:KeyID>0.000000</ns:KeyID><ns:Message> testing ...</ns:Message></ns:item></ns:DBListing></ns:getContractHdrResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
Everything in the ".h file" and ".c" file was changed so that it used "ns" namespace and not the "am" namespace

Related

WSDL for REST adaptor with file attachment in OSB 12C

I am using Oracle Service Bus 12C with REST services. I add proxy and business services and select to use WSDL with both.
A typical request WSDL would be:
<?xml version = '1.0' encoding = 'UTF-8'?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd"
xmlns:tns="http://TargetNamespace.com/LocationServices_getDistricts_request"
targetNamespace="http://TargetNamespace.com/LocationServices_getDistricts_request"
elementFormDefault="qualified" attributeFormDefault="unqualified" nxsd:encoding="US-ASCII">
<xsd:element name="Districts-Proxy-Request-Root-Element">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="db" type="xsd:string" minOccurs="0"/>
<xsd:element name="divisionId" type="xsd:integer" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:annotation>
<xsd:appinfo>NXSDSAMPLE=</xsd:appinfo>
<xsd:appinfo>USEHEADER=false</xsd:appinfo>
</xsd:annotation>
</xsd:schema>
And a response would be:
<?xml version = '1.0' encoding = 'UTF-8'?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://TargetNamespace.com/LocationServices_getDistricts_response"
targetNamespace="http://TargetNamespace.com/LocationServices_getDistricts_response"
xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd"
elementFormDefault="qualified"
nxsd:version="JSON" nxsd:encoding="US-ASCII">
<xsd:element name="Districts-Proxy-Response-Root-Element">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="statusCode" type="xsd:integer"/>
<xsd:element name="statusDescription" type="xsd:string"/>
<xsd:element name="data" minOccurs="0" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="districtId" type="xsd:integer" minOccurs="0"/>
<xsd:element name="districtName" type="xsd:string" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:annotation xmlns="">
<xsd:appinfo>NXSDSAMPLE=</xsd:appinfo>
<xsd:appinfo>USEHEADER=false</xsd:appinfo>
</xsd:annotation>
</xsd:schema>
I know how to handle requests and responses with strings and numbers. My question is, what would the WSDL be if the request had a file attachment? What if the response did?
Related to above, I use XQuery transformations to convert proxy requests to business requests and business responses to proxy responses. A typical response transformation file would be:
xquery version "1.0" encoding "utf-8";
(:: OracleAnnotationVersion "1.0" ::)
declare namespace ns1="http://TargetNamespace.com/LocationServices_getDistricts_response";
(:: import schema at "Districts-Response.xsd" ::)
declare variable $statusCode as xs:integer external;
declare variable $statusDescription as xs:string external;
declare variable $data external;
declare function local:func($statusCode as xs:integer, $statusDescription as xs:string, $data) as element()
(:: schema-element(ns1:Districts-Proxy-Response-Root-Element) ::) {
<ns1:Districts-Proxy-Response-Root-Element
xmlns:ns1="http://TargetNamespace.com/LocationServices_getDistricts_response">
<ns1:statusCode>{fn:data($statusCode)}</ns1:statusCode>
<ns1:statusDescription>{fn:data($statusDescription)}</ns1:statusDescription>
{
if ( $data eq "" ) then (
<ns1:data/>
) else (
for $x in $data/ns1:data
return <ns1:data>
<ns1:districtId>{fn:data($x/ns1:DISTRICTID)}</ns1:districtId>
<ns1:districtName>{fn:data($x/ns1:DISTRICTNAME)}</ns1:districtName>
</ns1:data>
)
}
</ns1:Districts-Proxy-Response-Root-Element>
};
local:func($statusCode, $statusDescription, $data)
What would the XQuery code be to handle attachments?

How to create a Mule Project v3.8 which redirects messages to an external Web Service?

I would like to create a Mule Project, and the idea is to send a SOAP message (for example through soapUI) to this project, and then, redirect the message to an external web service.
I have read the documentation, I can't figure out how to do this simple task.
I would appreciate if someone could help me. I am using Mule v3.8.
Thanks in advance.
You can use the Web Service Consumer connector as explained at MuleSoft Documentation and Video Tutorial
In general,
You can use:
HTTP endpoint (request-response) ->
CXF component (for you proxy service, optional) ->
Web Service Consumer (to call needed service)
If I'm not very clear, I can help you in building this project.
update
I made a simple service and now we have wsdl:
<wsdl:definitions name="SimpleServiceService" targetNamespace="http://simple/" xmlns:ns1="http://schemas.xmlsoap.org/soap/http" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://simple/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<wsdl:types>
<xs:schema elementFormDefault="unqualified" targetNamespace="http://simple/" version="1.0" xmlns:tns="http://simple/" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="doSomething" type="tns:doSomething"/>
<xs:element name="doSomethingResponse" type="tns:doSomethingResponse"/>
<xs:complexType name="doSomething">
<xs:sequence>
<xs:element minOccurs="0" name="Input" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="doSomethingResponse">
<xs:sequence>
<xs:element minOccurs="0" name="return" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
</wsdl:types>
<wsdl:message name="doSomethingResponse">
<wsdl:part element="tns:doSomethingResponse" name="parameters"/>
</wsdl:message>
<wsdl:message name="doSomething">
<wsdl:part element="tns:doSomething" name="parameters"/>
</wsdl:message>
<wsdl:portType name="SimpleService">
<wsdl:operation name="doSomething">
<wsdl:input message="tns:doSomething" name="doSomething"/>
<wsdl:output message="tns:doSomethingResponse" name="doSomethingResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="SimpleServiceServiceSoapBinding" type="tns:SimpleService">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="doSomething">
<soap:operation soapAction="" style="document"/>
<wsdl:input name="doSomething">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="doSomethingResponse">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="SimpleServiceService">
<wsdl:port binding="tns:SimpleServiceServiceSoapBinding" name="SimpleServicePort">
<soap:address location="http://exoldy-simple-mule-project.cloudhub.io/service"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Next we need to interact with this service using proxy service implemented on Mule
<mule xmlns:cxf="http://www.mulesoft.org/schema/mule/cxf" xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking" xmlns:ws="http://www.mulesoft.org/schema/mule/ws" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/ws http://www.mulesoft.org/schema/mule/ws/current/mule-ws.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/ee/tracking http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.xsd
http://www.mulesoft.org/schema/mule/cxf http://www.mulesoft.org/schema/mule/cxf/current/mule-cxf.xsd">
<ws:consumer-config name="Web_Service_Consumer" service="SimpleServiceService" port="SimpleServicePort" serviceAddress="http://exoldy-simple-mule-project.cloudhub.io/service" wsdlLocation="http://exoldy-simple-mule-project.cloudhub.io/service?wsdl" doc:name="Web Service Consumer"/>
<http:listener-config name="HTTP_Listener_Configuration1" host="0.0.0.0" port="8081" doc:name="HTTP Listener Configuration"/>
<flow name="external" initialState="started">
<http:listener config-ref="HTTP_Listener_Configuration1" path="service" doc:name="Receive HTTP request" doc:description="This endpoint receives an HTTP message."/>
<logger message="#[flow.name]" level="INFO" doc:name="Logger"/>
<cxf:proxy-service payload="body" doc:name="CXF" namespace="http://simple/" service="SimpleServiceService" wsdlLocation="http://exoldy-simple-mule-project.cloudhub.io/service?wsdl"/>
<ws:consumer config-ref="Web_Service_Consumer" operation="doSomething" doc:name="Web Service Consumer"/>
</flow>
</mule>
Now everything should work, at least it works for me )

How to call Wso2bps using wso2esb

I am using wso2esb4.8.0 and wso2bps3.0.1 while i am working with 2 servers both are working fine .But i wish incorporate both severs for that i written sample BPEL
sample BPLE file is like this
<bpel:process name="multiply2integers"
targetNamespace="http://wso2.org/bps/sample"
suppressJoinFailure="yes"
xmlns:tns="http://wso2.org/bps/sample"
xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
>
<!-- Import the client WSDL -->
<bpel:import location="multiply2integersArtifacts.wsdl" namespace="http://wso2.org/bps/sample"
importType="http://schemas.xmlsoap.org/wsdl/" />
<!-- ================================================================= -->
<!-- PARTNERLINKS -->
<!-- List of services participating in this BPEL process -->
<!-- ================================================================= -->
<bpel:partnerLinks>
<!-- The 'client' role represents the requester of this service. -->
<bpel:partnerLink name="client"
partnerLinkType="tns:multiply2integers"
myRole="multiply2integersProvider"
/>
</bpel:partnerLinks>
<!-- ================================================================= -->
<!-- VARIABLES -->
<!-- List of messages and XML documents used within this BPEL process -->
<!-- ================================================================= -->
<bpel:variables>
<!-- Reference to the message passed as input during initiation -->
<bpel:variable name="input"
messageType="tns:multiply2integersRequestMessage"/>
<!--
Reference to the message that will be returned to the requester
-->
<bpel:variable name="output"
messageType="tns:multiply2integersResponseMessage"/>
</bpel:variables>
<!-- ================================================================= -->
<!-- ORCHESTRATION LOGIC -->
<!-- Set of activities coordinating the flow of messages across the -->
<!-- services integrated within this business process -->
<!-- ================================================================= -->
<bpel:sequence name="main">
<!-- Receive input from requester.
Note: This maps to operation defined in multiply2integers.wsdl
-->
<bpel:receive name="start" partnerLink="client"
portType="tns:multiply2integers"
operation="process" variable="input"
createInstance="yes"/>
<!-- Generate reply to synchronous request -->
<bpel:assign validate="no" name="Assign">
<bpel:copy>
<bpel:from>
<bpel:literal>
<tns:multiply2integersResponse xmlns:tns="http://wso2.org/bps/sample" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><tns:mul>0</tns:mul>
</tns:multiply2integersResponse>
</bpel:literal>
</bpel:from>
<bpel:to variable="output" part="payload"></bpel:to>
</bpel:copy>
<bpel:copy>
<bpel:from>
<![CDATA[$input.payload/tns:c*$input.payload/tns:d]]>
</bpel:from>
<bpel:to part="payload" variable="output">
<bpel:query queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0"><![CDATA[tns:mul]]></bpel:query>
</bpel:to>
</bpel:copy>
</bpel:assign>
<bpel:reply name="end"
partnerLink="client"
portType="tns:multiply2integers"
operation="process"
variable="output"
/>
</bpel:sequence>
</bpel:process>
even i am publishing my bpel wsdl also
if i try with wso2bps TRYIT tool its working fine but while calling with wso2esb is not working
WSDL file is
<?xml version="1.0"?>
<definitions name="multiply2integers"
targetNamespace="http://wso2.org/bps/sample"
xmlns:tns="http://wso2.org/bps/sample"
xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TYPE DEFINITION - List of types participating in this BPEL process
The BPEL Designer will generate default request and response types
but you can define or import any XML Schema type and use them as part
of the message types.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<types>
<schema attributeFormDefault="unqualified" elementFormDefault="qualified"
targetNamespace="http://wso2.org/bps/sample"
xmlns="http://www.w3.org/2001/XMLSchema">
<element name="multiply2integersRequest">
<complexType>
<sequence>
<element name="c" type="int"/>
<element name="d" type="int"/>
</sequence>
</complexType>
</element>
<element name="multiply2integersResponse">
<complexType>
<sequence>
<element name="mul" type="int"/>
</sequence>
</complexType>
</element>
</schema>
</types>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MESSAGE TYPE DEFINITION - Definition of the message types used as
part of the port type defintions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<message name="multiply2integersRequestMessage">
<part name="payload" element="tns:multiply2integersRequest"/>
</message>
<message name="multiply2integersResponseMessage">
<part name="payload" element="tns:multiply2integersResponse"/>
</message>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PORT TYPE DEFINITION - A port type groups a set of operations into
a logical service unit.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<!-- portType implemented by the multiply2integers BPEL process -->
<portType name="multiply2integers">
<operation name="process">
<input message="tns:multiply2integersRequestMessage" />
<output message="tns:multiply2integersResponseMessage"/>
</operation>
</portType>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PARTNER LINK TYPE DEFINITION
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<plnk:partnerLinkType name="multiply2integers">
<plnk:role name="multiply2integersProvider" portType="tns:multiply2integers"/>
</plnk:partnerLinkType>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
BINDING DEFINITION - Defines the message format and protocol details
for a web service.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<binding name="multiply2integersBinding" type="tns:multiply2integers">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http" />
<operation name="process">
<soap:operation
soapAction="http://wso2.org/bps/sample/process" />
<input>
<soap:body use="literal" />
</input>
<output>
<soap:body use="literal" />
</output>
</operation>
</binding>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SERVICE DEFINITION - A service groups a set of ports into
a service unit.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<service name="multiply2integers">
<port name="multiply2integersPort" binding="tns:multiply2integersBinding">
<soap:address location="http://*********:8080/multiply2integers" />
</port>
</service>
</definitions>
and i written sample proxy which will call the BPEL endpoint that sample proxy define below
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="BPELProxy"
transports="https,http"
statistics="disable"
trace="disable"
startOnLoad="true">
<target>
<inSequence>
<property name="value1"
expression="//c/text()"
scope="default"
type="STRING"/>
<property name="value2"
expression="//d/text()"
scope="default"
type="STRING"/>
<payloadFactory media-type="xml">
<format>
<p:AddingPLRequest xmlns:p="http://wso2.org/bps/sample">
<c xmlns="http://wso2.org/bps/sample">$1</c>
<d xmlns="http://wso2.org/bps/sample">$2</d>
</p:AddingPLRequest>
</format>
<args>
<arg evaluator="xml" expression="get-property('c')"/>
<arg evaluator="xml" expression="get-property('d')"/>
</args>
</payloadFactory>
<log level="full"/>
<send>
<endpoint key="BPEL"/>
</send>
</inSequence>
<outSequence>
<send/>
</outSequence>
</target>
<description/>
</proxy>
defined endpoint view is my endpoint is
<endpoint xmlns="http://ws.apache.org/ns/synapse" name="BPEL">
<address uri="http://*************:9763/services/multiply2integers/" format="soap12">
<suspendOnFailure>
<progressionFactor>1.0</progressionFactor>
</suspendOnFailure>
<markForSuspension>
<retriesBeforeSuspension>0</retriesBeforeSuspension>
<retryDelay>0</retryDelay>
</markForSuspension>
</address>
</endpoint>
i am sending request from CURL command to ESB I am getting errors my CURL Command is.
curl -v -H "Accept: application/json" -H "Content-Type:application/json" -d '{"c":"55","d":"3"}' http://***t:8282/services/BPELProxy
and its showing errors if i change the format of endpoint its showing some other error error log like this
[2014-01-13 15:20:01,070] INFO {org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} - 'admin#carbon.super [-1234]' logged in at [2014-01-13 15:20:01,070+0530]
[2014-01-13 15:22:44,887] WARN {org.wso2.carbon.server.admin.module.handler.AuthenticationHandler} - Illegal access attempt at [2014-01-13 15:22:44,0886] from IP address null while trying to authenticate access to service StatisticsAdmin
[2014-01-13 15:22:44,887] ERROR {org.wso2.carbon.statistics.ui.StatisticsAdminClient} - Cannot get service stats for service multiply2integers. Backend server may be unavailable.
org.apache.axis2.AxisFault: The input stream for an incoming message is null.

Ant xmlvalidate cvc-elt.1.a: Cannot find the declaration of element 'topic'

I've made an xsd that represent a restriction of docbook topic. Here is a basic xml example of that. The restriction should be valid within docbook namespace.
<?xml version="1.0" encoding="UTF-8"?>
<topic
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://docbook.org/ns/docbook"
xmlns:math="http://www.w3.org/2005/xpath-functions/math"
xml:id="TT_LONDON002-003CONTEN" role="imprint">
<title>title</title>
</topic>
The top of the xsd restriction looks like the following. In oxygen the xml validates nicely.
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
targetNamespace="http://docbook.org/ns/docbook"
xmlns:docbook="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink">
<xs:import namespace="http://www.w3.org/1999/xlink"
schemaLocation="xlink.xsd"/>
<xs:import namespace="http://www.w3.org/XML/1998/namespace"
schemaLocation="xml.xsd"/>
<xs:element name="topic">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0"
maxOccurs="unbounded"
ref="docbook:title"/>
<xs:choice>
<xs:element ref="docbook:mediaobject"/>
<xs:element minOccurs="0"
maxOccurs="unbounded"
ref="docbook:para"/>
</xs:choice>
</xs:sequence>
However I'm trying to write the following ant script to validate a whole directory.
I get error output: cvc-elt.1.a: Cannot find the declaration of element 'topic'.
I've been searching online but can't find the solution.
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="dist" name="ANTProject">
<target name="dist">
<property name="xmlDir" value="../xml/"/>
<pathconvert dirsep="/" property="xsd.file">
<path>
<pathelement location="../xsd/topic.xsd"/>
</path>
</pathconvert>
<xmlvalidate lenient="true"
failonerror="false"
warn="true"
classname="org.apache.xerces.parsers.SAXParser"
classpath="../../lib/xercesImpl.jar">
<fileset dir="${xmlDir}" includes="**/*.xml"/>
<attribute name="http://xml.org/sax/features/validation"
value="true"/>
<attribute name="http://xml.org/sax/features/namespaces"
value="true"/>
<attribute name="http://apache.org/xml/features/validation/schema"
value="true"/>
<property name="http://apache.org/xml/properties/schema/external-schemaLocation"
value="${xsd.file}"/>
</xmlvalidate>
</target>
</project>
Any ideas?
Thanks
Conteh

IllegalArgumentException: key can't be empty -- Which Key?

Trying to build a demo contract-first service from a sample WSDL (using CXF 2.7.1):
<?xml version='1.0' encoding='UTF-8'?>
<wsdl:definitions name="OrderProcessService" targetNamespace="http://order.demo/" xmlns:ns1="http://schemas.xmlsoap.org/soap/http" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://order.demo/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<wsdl:types>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="http://order.demo/" xmlns:tns="http://order.demo/" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="processOrder" type="tns:processOrder" />
<xs:element name="processOrderResponse" type="tns:processOrderResponse" />
<xs:complexType name="processOrder">
<xs:sequence>
<xs:element minOccurs="0" name="arg0" type="tns:order" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="order">
<xs:sequence>
<xs:element minOccurs="0" name="customerID" type="xs:string" />
<xs:element minOccurs="0" name="itemID" type="xs:string" />
<xs:element name="price" type="xs:double" />
<xs:element name="qty" type="xs:int" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="processOrderResponse">
<xs:sequence>
<xs:element minOccurs="0" name="return" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:schema>
</wsdl:types>
<wsdl:message name="processOrderResponse">
<wsdl:part element="tns:processOrderResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="processOrder">
<wsdl:part element="tns:processOrder" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:portType name="OrderProcess">
<wsdl:operation name="processOrder">
<wsdl:input message="tns:processOrder" name="processOrder">
</wsdl:input>
<wsdl:output message="tns:processOrderResponse" name="processOrderResponse">
</wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="OrderProcessServiceSoapBinding" type="tns:OrderProcess">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="processOrder">
<soap:operation soapAction="" style="document" />
<wsdl:input name="processOrder">
<soap:body use="literal" />
</wsdl:input>
<wsdl:output name="processOrderResponse">
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="OrderProcessService">
<wsdl:port binding="tns:OrderProcessServiceSoapBinding" name="OrderProcessPort">
<soap:address location="http://localhost:8080/OrderProcess" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
I issued the following:
wsdl2java -ant -impl -server -d src OrderProcess.wsdl
Source code generation goes fine but when I try to build the server, using ant OrderProcessServer, I receive the following exception:
OrderProcessServer:
[java] Starting Server
[java] Exception in thread "main" java.lang.ExceptionInInitializerError
[java] at org.eclipse.jetty.util.component.AbstractLifeCycle.<clinit>(AbstractLifeCycle.java:33)
[java] at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.activate(JettyHTTPDestination.java:178)
[java] at org.apache.cxf.transport.AbstractObservable.setMessageObserver(AbstractObservable.java:48)
[java] at org.apache.cxf.binding.AbstractBaseBindingFactory.addListener(AbstractBaseBindingFactory.java:95)
[java] at org.apache.cxf.binding.soap.SoapBindingFactory.addListener(SoapBindingFactory.java:895)
[java] at org.apache.cxf.endpoint.ServerImpl.start(ServerImpl.java:131)
[java] at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:360)
[java] at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:251)
[java] at org.apache.cxf.jaxws.spi.ProviderImpl.createAndPublishEndpoint(ProviderImpl.java:152)
[java] at javax.xml.ws.Endpoint.publish(Endpoint.java:57)
[java] at demo.order.OrderProcess_OrderProcessPort_Server.<init>(OrderProcess_OrderProcessPort_Server.java:19)
[java] at demo.order.OrderProcess_OrderProcessPort_Server.main(OrderProcess_OrderProcessPort_Server.java:23)
[java] Caused by: java.lang.IllegalArgumentException: key can't be empty
[java] at java.lang.System.checkKey(System.java:774)
[java] at java.lang.System.getProperty(System.java:647)
[java] at org.eclipse.jetty.util.log.Log$1.run(Log.java:122)
[java] at java.security.AccessController.doPrivileged(Native Method)
[java] at org.eclipse.jetty.util.log.Log.<clinit>(Log.java:85)
[java] ... 12 more
[java] Java Result: 1
BUILD SUCCESSFUL
Total time: 2 seconds
My questions are:
What key?
How do provide it so that I don't get the exception?
Why is wsdl2java producing code that is incomplete? (i.e. isn't the .wsdl file sufficient?)
UPDATE: The ANT build.xml file produced by the wsdl2java command has these 2 seemingly relevant lines:
<sysproperty key="java.util.logging.config.file" value="${cxf.etc.dir}/logging.properties"/>
<sysproperty key="log4j.configuration" value="file:///${cxf.etc.dir}/log4j.properties"/>
Are they key (no pun intended) to the problem?
If so, what values should I put there in order to fix it?
How do I tell wsdl2java to generate code that I don't need to fix?
Jetty's Log implementation is reading the system properties like this:
Enumeration<String> systemKeyEnum = Enumeration<String>)System.getProperties().propertyNames();
while (systemKeyEnum.hasMoreElements())
{
String key = systemKeyEnum.nextElement();
String val = System.getProperty(key);
// ... (process key/values)
}
For some reason you have managed to have an empty key: "" in your System properties. So check all the places where you set System Properties programmatically (System.setProperty) and your java commandline for -D options.
If that doesn't help, try to print your system properties before this exception occurs or do a jpda debug session and place a breakpoint either at Log line <122 or at System.checkKey().
The empty keys come from the cxfrun macro in the generated ant script, build.xml.
Comment it out like so and you should be fine:
<arg value="#{param1}"/>
<arg value="#{param2}"/>
<arg value="#{param3}"/>
<arg value="#{param4}"/>
<arg value="#{param5}"/>
<jvmarg value="${cxf.endorsed.flag}"/>
<!-- Commented out to remove empty keys in system properties -->
<!-- jvmarg value="#{jvmarg1}"/>
<jvmarg value="#{jvmarg2}"/>
<jvmarg value="#{jvmarg3}"/>
<jvmarg value="#{jvmarg4}"/>
<jvmarg value="#{jvmarg5}"/ -->
The empty key can also come from "comments", of this type:
=====================================
This line above may have been marked as a comment, but the system is going to think of the equals sign as a key value marker.

Resources