[JBossWS] - bind datatype javax.xml.datatype.XMLGregorianCalendar to jav
by tpawankumar
Hi All,
When i generated schema classes from jaxb 2.1.5.It generated XMLGregorianCalendar data type for xml type xsd:date.Then i changed my schema adding inline annotations and binded the XMLGregorianCalendar to Calendar.Following is the code that i have added in my schema.
<xsd:annotation><xsd:appinfo>
| <jaxb:globalBindings>
| <jaxb:javaType name="java.util.Calendar" xmlType="xsd:date"
| parseMethod="javax.xml.bind.DatatypeConverter.parseDate"
| printMethod="javax.xml.bind.DatatypeConverter.printDate"
| />
| </jaxb:globalBindings>
| </xsd:appinfo></xsd:annotation>
But When i generated the client stubs using wsconsume from the WSDL it is still generating XMLGregorianCalendar data type.
So my question what should i do to bind the data type XMLGregorianCalendar to Calendar in client side stubs,
but i should not change the WSDL.
Please help me.
Thanks
Pavan
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4102493#4102493
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4102493
16 years, 6 months
[JBossWS] - wsconsume
by aleks
On the "other side" was made web service with Borland Developer Studio 2006.
WSDL file is:
| <?xml version="1.0" encoding="UTF-8"?>
| <definitions name="Iws1CAccessservice" targetNamespace="http://tempuri.org/"
| xmlns = "http://schemas.xmlsoap.org/wsdl/"
| xmlns:xs = "http://www.w3.org/2001/XMLSchema"
| xmlns:tns = "http://tempuri.org/"
| xmlns:soap = "http://schemas.xmlsoap.org/wsdl/soap/"
| xmlns:soapenc = "http://schemas.xmlsoap.org/soap/encoding/"
| xmlns:mime = "http://schemas.xmlsoap.org/wsdl/mime/"
| xmlns:ns1 = "urn:ws1CAccessUnit">
| <types>
| <xs:schema targetNamespace="urn:ws1CAccessUnit" xmlns="urn:ws1CAccessUnit">
| <xs:complexType name="T1CDocumentList">
| <xs:complexContent>
| <xs:restriction base="soapenc:Array">
| <xs:sequence/>
| <xs:attribute ref="soapenc:arrayType" n1:arrayType="ns1:T1CDocument[]" xmlns:n1="http://schemas.xmlsoap.org/wsdl/"/>
| </xs:restriction>
| </xs:complexContent>
| </xs:complexType>
| <xs:complexType name="T1CDocument">
| <xs:sequence>
| <xs:element name="Date" type="xs:dateTime"/>
| <xs:element name="Number" type="xs:string"/>
| <xs:element name="Rows" type="ns1:T1CDocumentRows"/>
| </xs:sequence>
| </xs:complexType>
| <xs:complexType name="T1CDocumentRows">
| <xs:complexContent>
| <xs:restriction base="soapenc:Array">
| <xs:sequence/>
| <xs:attribute ref="soapenc:arrayType" n1:arrayType="ns1:T1CDocumentRow[]" xmlns:n1="http://schemas.xmlsoap.org/wsdl/"/>
| </xs:restriction>
| </xs:complexContent>
| </xs:complexType>
| <xs:complexType name="T1CDocumentRow">
| <xs:sequence>
| <xs:element name="Product" type="xs:string"/>
| <xs:element name="ProductID" type="xs:string"/>
| <xs:element name="Quantity" type="xs:double"/>
| <xs:element name="QuantityRequested" type="xs:double"/>
| <xs:element name="Price" type="xs:double"/>
| <xs:element name="Amount" type="xs:double"/>
| <xs:element name="Total" type="xs:double"/>
| <xs:element name="Cell" type="xs:string"/>
| </xs:sequence>
| </xs:complexType>
| </xs:schema>
| </types>
| <message name="Get1CDocumentList0Request">
| <part name="dDateFrom" type="xs:dateTime"/>
| <part name="dDateTo" type="xs:dateTime"/>
| </message>
| <message name="Get1CDocumentList0Response">
| <part name="return" type="ns1:T1CDocumentList"/>
| </message>
| <portType name="Iws1CAccess">
| <operation name="Get1CDocumentList">
| <input message="tns:Get1CDocumentList0Request"/>
| <output message="tns:Get1CDocumentList0Response"/>
| </operation>
| </portType>
| <binding name="Iws1CAccessbinding" type="tns:Iws1CAccess">
| <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
| <operation name="Get1CDocumentList">
| <soap:operation soapAction="urn:ws1CAccessUnit-Iws1CAccess#Get1CDocumentList" style="rpc"/>
| <input message="tns:Get1CDocumentList0Request">
| <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:ws1CAccessUnit-Iws1CAccess"/>
| </input>
| <output message="tns:Get1CDocumentList0Response">
| <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:ws1CAccessUnit-Iws1CAccess"/>
| </output>
| </operation>
| </binding>
| <service name="Iws1CAccessservice">
| <port name="Iws1CAccessPort" binding="tns:Iws1CAccessbinding">
| <soap:address location="http://my.domain.ru/cgi-bin/ws1CAccess.exe/soap/Iws1CAccess"/>
| </port>
| </service>
| </definitions>
|
I try to consume this web service with wsconsume and get the error:
[WARNING] src-resolve.4.2: Error resolving component 'soapenc:Array'. It was detected that 'soapenc:Array' is in namespace 'http://schemas.xmlsoap.org/soap/encoding/', but components from this namespace are not referenceable from schema document 'file:/home/alex/webapps/korund-ws.xml#types?schema1'. If this is the incorrect namespace, perhaps the prefix of 'soapenc:Array' needs to be changed. If this is the correct namespace, then an appropriate 'import' tag should be added to 'file:wsdl.xml#types?schema1'.
| line 14 of file:wsdl.xml#types?schema1
|
| [ERROR] undefined simple or complex type 'soapenc:Array'
| line 14 of file:wsdl.xml
|
| [ERROR] undefined attribute 'soapenc:arrayType'
| line 16 of file:wsdl.xml
|
| [ERROR] undefined simple or complex type 'soapenc:Array'
| line 29 of file:wsdl.xml
|
| [ERROR] undefined attribute 'soapenc:arrayType'
| line 31 of file:wsdl.xml
|
| Failed to invoke WsImport
| java.lang.NullPointerException
| at com.sun.tools.xjc.reader.internalizer.SCDBasedBindingSet.apply(SCDBasedBindingSet.java:237)
| at com.sun.tools.xjc.ModelLoader.createXSOM(ModelLoader.java:518)
| at com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:232)
| at com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:85)
| at com.sun.tools.ws.processor.modeler.wsdl.JAXBModelBuilder.bind(JAXBModelBuilder.java:120)
| at com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.buildJAXBModel(WSDLModeler.java:2173)
| at com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.internalBuildModel(WSDLModeler.java:173)
| at com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.buildModel(WSDLModeler.java:119)
| at com.sun.tools.ws.wscompile.WsimportTool.run(WsimportTool.java:148)
| at org.jboss.ws.tools.jaxws.impl.SunRIConsumerImpl.consume(SunRIConsumerImpl.java:187)
| at org.jboss.wsf.spi.tools.cmd.WSConsume.importServices(WSConsume.java:216)
| at org.jboss.wsf.spi.tools.cmd.WSConsume.main(WSConsume.java:79)
|
On wich side is the problem?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4102460#4102460
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4102460
16 years, 6 months
[JBossWS] - Problem with wsconsume ant task
by tpawankumar
Hi All,
I am using wsconsume ant task for generating client side artifacts.
The following is ant task
| <target name="generateStub2" description="Generates classes">
| <taskdef name="wsconsume" classname="org.jboss.wsf.spi.tools.ant.WSConsumeTask">
| <classpath refid="wscon.classpath"/>
| </taskdef>
| <wsconsume
| verbose="true"
| destdir="output2"
| sourcedestdir="gen-src2"
| keep="true"
| wsdl="http://localhost:8080/McafeeAdapter?wsdl">
| </wsconsume>
| <jar destfile="./lib/client.jar" basedir="./output2">
| </jar>
| </target>
It is able to generate stubs using local WSDL file.
But when i use the following task for remote WSDL file
| <target name="generateStub1" description="Generates classes">
| <taskdef name="wsconsume" classname="org.jboss.wsf.spi.tools.ant.WSConsumeTask">
| <classpath refid="wscon.classpath"/>
| </taskdef>
| <wsconsume
| verbose="true"
| destdir="output1"
| sourcedestdir="gen-src1"
| keep="true"
| wsdl="http://testdrive.mcafeeasap.com/ws/mop/mop.asmx?wsdl">
| </wsconsume>
| <jar destfile="./lib/mcafeeClient.jar" basedir="./output1">
| </jar>
| </target>
|
It is giving following exception
[wsconsume] Consuming wsdl: http://testdrive.mcafeeasap.com/ws/mop/mop.asmx?wsdl
[wsconsume] parsing WSDL...
[wsconsume] [ERROR] Failed to read the WSDL document: http://testdrive.mcafeeasap.com/ws/mop/mop.asmx?wsdl, because 1) could not find the document; /2) the document could not be read; 3) the root element of the document is not <wsdl:definitions>.
[wsconsume] unknown location
[wsconsume] Failed to parse the WSDL.
[wsconsume] Failed to invoke WsImport
[wsconsume] java.lang.IllegalStateException: WsImport invocation failed. Try the verbose switch for more information
[wsconsume] at org.jboss.ws.tools.jaxws.impl.SunRIConsumerImpl.consume(SunRIConsumerImpl.java:190)
[wsconsume] at org.jboss.wsf.spi.tools.WSContractConsumer.consume(WSContractConsumer.java:189)
[wsconsume] at org.jboss.wsf.spi.tools.ant.WSConsumeTask.executeNonForked(WSConsumeTask.java:206)
[wsconsume] at org.jboss.wsf.spi.tools.ant.WSConsumeTask.execute(WSConsumeTask.java:226)
[wsconsume] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:269)
[wsconsume] at org.apache.tools.ant.Task.perform(Task.java:364)
[wsconsume] at org.apache.tools.ant.Target.execute(Target.java:301)
[wsconsume] at org.apache.tools.ant.Target.performTasks(Target.java:328)
[wsconsume] at org.apache.tools.ant.Project.executeTarget(Project.java:1215)
[wsconsume] at org.apache.tools.ant.Project.executeTargets(Project.java:1063)
[wsconsume] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:377)
[wsconsume] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:135)
The following are the jars which are used for running the task
| <path id="wscon.classpath" >
| <pathelement path ="./lib/activation.jar"/>
| <pathelement path ="./lib/tools.jar"/>
| <pathelement path ="./lib/getopt.jar"/>
| <pathelement path ="./lib/wstx.jar"/>
| <pathelement path ="./lib/jbossall-client.jar"/>
| <pathelement path ="./lib/log4j.jar"/>
| <pathelement path ="./lib/mail.jar"/>
| <pathelement path ="./lib/jbossws-spi.jar"/>
| <pathelement path ="./lib/jaxws-tools.jar"/>
| <pathelement path ="./lib/jaxws-rt.jar"/>
| <pathelement path ="./lib/stax-api.jar"/>
| <pathelement path ="./lib/jaxb-api.jar"/>
| <pathelement path ="./lib/jaxb-impl.jar"/>
| <pathelement path ="./lib/jaxb-xjc.jar"/>
| <pathelement path ="./lib/stax-ex.jar"/>
| <pathelement path ="./lib/streambuffer.jar"/>
| <pathelement path ="./lib/javassist.jar"/>
| <pathelement path ="./lib/jboss-xml-binding.jar"/>
| <pathelement path ="./lib/jboss-jaxws.jar"/>
| <pathelement path ="./lib/jbossws-client.jar"/>
| <pathelement path ="./lib/jboss-jaxrpc.jar"/>
| <pathelement path ="./lib/jboss-saaj.jar"/>
| </path>
I am not getting what the problem is?
Am i missing any jars ,if the WSDL is remote.
Please help me.
Thanks in Advance.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4102409#4102409
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4102409
16 years, 6 months
[JBossWS] - Re: service-name-pattern
by Sefai
This is the debug output of JBossAS
2007-11-06 17:58:34,493 DEBUG [org.jboss.ws.metadata.umdm.EndpointMetaData] Configure SOAPBinding
| 2007-11-06 17:58:34,493 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerResolverImpl] initHandlerChain: PRE
| 2007-11-06 17:58:34,493 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerResolverImpl] initHandlerChain: ENDPOINT
| 2007-11-06 17:58:34,493 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerResolverImpl] initHandlerChain: POST
| 2007-11-06 17:58:34,493 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerResolverImpl] addHandler:
| HandlerMetaDataJAXWS:
| type=POST
| name=WSSecurity Handler Client(x509v3)
| class=class org.jboss.ws.extensions.security.jaxws.WSSecurityHandlerClient
| params=[]
| protocols=null
| services={http://mywebservice.org/}MyWebService
| ports=null
And this is the client-config
<jaxws-config xmlns="urn:jboss:jaxws-config:2.0"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xmlns:javaee="http://java.sun.com/xml/ns/javaee"
| xsi:schemaLocation="urn:jboss:jaxws-config:2.0 jaxws-config_2_0.xsd">
| <client-config>
| <config-name>
| My Web Service Client Security Config
| </config-name>
| <post-handler-chains>
| <javaee:handler-chain>
| <javaee:service-name-pattern xmlns:myns="http://mywebservice.org/">
| myns:MyWebService
| </javaee:service-name-pattern>
| <javaee:handler>
| <javaee:handler-name>
| WSSecurity Handler Client(x509v3)
| </javaee:handler-name>
| <javaee:handler-class>
| org.jboss.ws.extensions.security.jaxws.WSSecurityHandlerClient
| </javaee:handler-class>
| </javaee:handler>
| </javaee:handler-chain>
| </post-handler-chains>
| </client-config>
| </jaxws-config>
This seems to me OK.
What you say about this?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4102261#4102261
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4102261
16 years, 6 months