Working with complex data types in web services ...

Hi All,
I have created a webservice and created an interface for that in ADF. Now as my web service returns a complex data type, i followed the steps given in this article "http://www.oracle.com/technology/products/jdev/howtos/1013/wsadf/adfcomplexwstypes.html" and it works fine, my results also get displayed. But only issue is i get a warning "JBO-25009: Cannot create an object of type:java.util.calendar with value:2008-09-23T23:51:30.000+05:30" and if i replace all the java.util.Date with oracle.jbo.domain.Date then i get a warning "JBO-25009: Cannot create an object of type:oracle.jbo.domain.Date with value:2008-09-23T23:51:30.000+05:30". Now i am unable to understand this although i believe it is a data type mapping issue, but not sure how to rectify it.
Anybody knows the wayout?
Regards
Lokesh

Andre,
Thanks for youe response. I also tried makeing data type as string in place of date in data control.xml and it worked fine. So it confirms that i am facing with exactly similar issue as yours.
I tried solution 2 mentioned in Frank's mail but its not helping[in fact i am already using web proxy as i am delaing with complex data types]. I created a web proxy and in java bean i placed break points to check the control flow[in order to check the root cause] but control never reaches the java bean!! I am not sure about the cause for it...control should pass through java bean isn't it??
I am quite new to SOA...so can somebody just elaborate on how to rectify this using web proxy. I have been using this rl "http://www.oracle.com/technology/products/jdev/howtos/1013/wsadf/adfcomplexwstypes.html" to work with web proxies" to work with proxies.
Regards
Lokesh

Similar Messages

  • Custom/Complex data types in web services

    Hi,
    I've read in several articles here on otn that JDev 9.0.3 would have better support for
    creating web services with complex datatypes (like java.util.LinkedList), but still (in the 9.0.3 Preview)
    theese methods are greyed out on the web service wizard. Am I missing something?
    Until now I've worked with Custom Serializers, but they are time consuming and hard to work with.
    /Mattias

    Here are the two articles that will help:
    JavaBeans as Web services parameter types:
    http://otn.oracle.com/tech/webservices/htdocs/samples/customtype/content.html
    Registering Web services custom serializers:
    http://otn.oracle.com/tech/webservices/htdocs/samples/serialize/content.html
    The new support in JDev 9.0.3 is that JavaBean parameters are now recognized by the JDev publishing wizards whereas in JDev 9.0.2 there was the workaround pointed to by the first article. In 9.0.2 the publishing support was only for primitive data types.
    The upside of the custom serializers, is you can re-use your existing serializers if they happen to have been written to Apache SOAP.
    Mike.

  • Problem with datetime data type in Web Service

    Hi,
      I created local ABAP proxy based on a WSDL and some of the fields for the SOAP methods has data type datetime:
    name="MsgEndTimeStamp" type="s:dateTime" />
    name="MsgStatus" type="s:string"/>
    Since ABAP stack doesnt support dataTime data type it has created the proxy method with data type STRING.  Now when I call the proxy method (consuming the service) I get an error:
    <CODE>SoapFaultCode:4</CODE>
    <ERRORTEXT>Server was unable to read request. --> There is an error in XML document (1, 626). --> String was not recognized as a valid DateTime.</ERRORTEXT>
    I am sure others have faced the same issue.  Can someone help?
    Thanks

    Thanks but I dont think that link is much relevant to the problems I am facing, because I cannot change the web service definition as it is used by many others.  Also the target application runs on oracle so thats why some of the fields are datetime and I dont want to change that, even if I could.
    I am just stuck in creating the wrapper program to call the service since the SAP converts datetime data type to string and when the messages gets to the application it cannot convert string -> datetime.
    thanks anyway

  • Creating Web service for PL/SQL Procedure with Complex Data Types

    I need to created web service for PL/SQL Procedure with Complex Data types like table of records as parameters, how do we map the pl/sql table type parameters with web service, how to go about these?

    Hello,
    When you are creating a service from a Stored Procedure, the OracleAS WS tools will create necessary Java and PL wrapper code to handle the complex types (table of record) properly and make them compatible with XML format for SOAP messages.
    So what you should do is to use JDeveloper or WSA command line, to create a service from your store procedure and you will see that most of the work will be done for you.
    You can find more information in the:
    - Developing Web Services that Expose Database Resources
    chapter of the Web Service Developer's guide.
    Regards
    Tugdual Grall

  • Call a method with complex data type from a DLL file

    Hi,
    I have a win32 API with a dll file, and I am trying to call some methods from it in the labview. To do this, I used the import library wizard, and everything is working as expected. The only problem which I have is with a method with complex data type as return type (a vector). According to this link, import library wizard can not import methods with complex data type.
    The name of this method is this:   const std::vector< BlackfinInterfaces::Count > Counts ()
    where Count is a structure defined as below:
    struct Count
       Count() : countTime(0) {}
       std::vector<unsigned long> countLines;
       time_t countTime;
    It seems that I should manually use the Call Library Function Node. How can I configure parameters for the above method?

    You cannot configure Call Library Function Node to call this function.  LabVIEW has no way to pass a C++ class such as vector to a DLL.

  • Consuming an ASP web service which responds with complex data types...

    Here's my problem - I'm trying to consume a web service from a provider that uses complex data types.
    The starting part of the WSDL looks like this (I've not included the whole thing) - named have been changed to protect the innocent:
    <wsdl:definitions targetNamespace="http://domain_name">
    <wsdl:types>
    <s:schema elementFormDefault="qualified" targetNamespace="http://domain_name">
    <s:element name="Authentication">
    <s:complexType>
    <s:sequence>
    <s:element minOccurs="0" maxOccurs="1" name="Username" type="s:string"/>
    <s:element minOccurs="0" maxOccurs="1" name="Password" type="s:string"/>
    <s:element minOccurs="0" maxOccurs="1" name="Token"/>
    </s:sequence>
    </s:complexType>
    </s:element>
    <s:element name="AuthenticateResponse">
    <s:complexType>
    <s:sequence>
    <s:element minOccurs="1" maxOccurs="1" name="AuthOK" type="s:int"/>
    <s:element minOccurs="0" maxOccurs="1" name="Token"/>
    </s:sequence>
    </s:complexType>
    </s:element>
    Since it's a complexType return, with a sequence, I'd expect an array or structure returned, but instead I just get the "AuthOK" value, and no way to get anything else.
    Here are the ways I've tried calling it:
    <cfscript>
        WS = createObject("webservice", "https://WSDL_URL");
        WS_ret = WS.Authentication(Username = "username", Password = "password", Token = "");
    </cfscript>
    <cfdump var="#WS_ret#" />
    <cfinvoke webservice="WSDL_URL" method="Authentication" returnVariable="WS_ret">
        <cfinvokeargument name="userID" value="7253320" />
        <cfinvokeargument name="password" value="ctpjxs3" />
        <cfinvokeargument name="SecurityToken" value="" />
    </cfinvoke>
    <cfdump var="#WS_ret#" />
    Any ideas how I can get the other variables in the sequence? I have other calls after this that have a much larger amount of variables, and as such I can't use it without being about to get more of the

    Thanks for the reply.
    If I CFDUMP the variable it returns just "1", no XML tags, nothing at all around the data - according to the web service providers they say that they are supplying the Token part as long as the first variable is "1" (a logical true if the authentication passed). If it is "0" then no Token is returned, that is why it's optional.
    As for the CFdocs issue, look here:
    http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=webservices_25.html
    The paragraph before it (about 2/3 down the page) states:
    In this example, the operation updateEmployeeInfo takes a complex type as input and returns a complex type as output. To handle the input parameter, you create a structure. To handle the returned value, you write it to a ColdFusion variable, as the following example shows:
    It even states that you call "updateEmployeeInfo", and nowhere mentions "echoStruct" as a method - it's seemingly been put in as a random method name, or a function call for something else. The WSDL above the example only mentions "updateEmployeeInfo" and "updateEmployeeInfoSoapOut", again not mentioning "echoStruct".
    I see this as an error in the docs as it's calling a non-existant entity in the WSDL, which should cause a run-time error.

  • Complex data type to application service create method(CRUD)(Urgent)

    Hi Experts,
    I have created an entity service with remote persistency(Web service).i am mapping the entity service CRUD methodes to web service methodes and i am calling these CRUD methodes form the corresponding applicaion service CRUD methodes.With out complex data types both sevices are working  fine.I have tested them in the service browser.
    Later I have created a complex data type in the entity service and mapped it to web service.But when i am creating the application service create(CRUD) method for this entity service the complex data type which i have created in the entity service is not being shown as possible input attributes of the application service create method.Due to this i am not able to pass this complex attribute form the application service create method to the entity service create method.
    Plz tell me how can i resilve this issue.(Urgent)
    Thanks
    Sampath.G

    Hi Sampath,
    Please check SAP note 1004108. I think the issue you describe is one of the limitations described in this note.
    Regards,
       Jan

  • ++Custom Serialization with Complex Data type (Nested Classes)

    Hi,
    We have a scenario wherein we need to write CUSTOM SERIALIZERS for complex datatypes like INVOICE & ORDER (INVOICE inturn has ADDRESS type among others, ORDER has ADDRESS type, a COLLECTION of type ORDERITEM each of which are Java Classes in themselves)
    The example of Custom Serializer given in the SOA AS Dev Guide http://download.oracle.com/docs/cd/B31017_01/web.1013/b28975/custserial.htm#CFHHIBCA)
    shows only a simple java type used for serialization and deserialization.
    Can anyone please help us out by sharing any example depicting the CUSTOM SERIALIZERs for COMPLEX DATA TYPES?
    Thanks in advance,
    Pavan.

    Hello,
    Could you please post the code of your classes in the forum (at least the interfaces) ?
    Regards
    Tugdual Grall

  • Web Services with Complex Data Types in ADF 11g

    Shay Shmeltzer's following blogpost can answer my questions but all the links there
    http://blogs.oracle.com/shay/2009/09/web_services_with_complex_data.html
    Can you please point us to the correct links for the following documents?
    http://www.oracle.com/technology/tech/fmw4apps/agile/pdf/adf11g-agile.pdf
    http://www.oracle.com/technology/products/jdev/tips/fnimphius/wsdccomplexinputtype/index.html

    Thanks. We are using a Java Proxy to consume the web service as we need to use JAX-WS handlers. We created data control from the service stub that was created by the proxy. Our issue is with the response XML which comes as a complex type. Also, the data control is understanding the complex type and is creating the structure right. The problem is when we drag that control on a JSF page. No data is displayed. We think that we are not traversing the complex object properly which is creating the issue.
    I understand that you answer related to the input is applicable to output as well. We can change the structure by flattening it but we thought that in 11G there is some new features where we can use the complex types out of the box without any change. Is that true? Also, any luck in finding the documents (broken links) on your blog page?

  • Custom data types for Web Service services

    Instead of language primitives (int, double) or Strings, is it possible to define custom data types (i.e. classes) for use in a service method argument or as a service return type? For example, if I create a class called MyClass then could I use it as an argument n a service as follows: someServiceMethod( MyClass myClassInstance). A service returning the custom type might look like this: MyClass getTheClassServiceMethod(String someString). Are either of these ideas possible?

    Hi there,
    you can use your own classes as service method argument or return type. But you should not forget to do a type mapping on both the service and client side.
    I can tell you, how I am sending and receiving my own datatype called "FileBean" which is a simple JavaBean with getter() and setter() methods for the properties.
    I'm using axis for deployment and tomcat as the web server, where my service runs on (currently only local but in future this will be remote).
    Service class: "InstallationService.java"
    Bean class: "FileBean.java"
    Client class: "FileSaving.java"
    My deploy.wsdd file has the following entry:
    <beanMapping qname="myNS:FileBean"
      xmlns:myNS="http://packageDelarationBackwards"
      languageSpecificType="java:packageDeclaration.FileBean"/>
    ...The method header in my service:
    public FileBean storeAttachments(FileBean file)The important part of my Client:
    QName qnFileBean = new QName("http://packageDelcarationBackwards", "FileBean");
    call = (Call) service.createCall();
    call.setTargetEndpointAddress( new java.net.URL(endpointURL) );
    call.setOperationName(new QName("InstallationService","storeAttachments"));
    call.setReturnType(qnFileBean);
    call.registerTypeMapping(
                            FileBean.class,
                            qnFileBean,
                            new BeanSerializerFactory(FileBean.class, qnFileBean),
                            new BeanDeserializerFactory(FileBean.class, qnFileBean));
    ....After deploying the service and starting the server I can send my "FileBean", work with it and give it back.
    Hope this helped. If you need more information, just let me know.
    Steffi

  • Complex Return types from web service

    Hi,
    Iam developing a web service using axis.In that i want to return array of objects to the client.
    But when iam calling from the client side iam getting the class cast exception.
    I wrote server-config.wsdd file manually. do i need to add any more if i want to return array of java beans.
    server-config.wsdd
    <service name="MyService" provider="java:RPC">
        <requestFlow>
          <handler type="soapmonitor"/>
        </requestFlow>
        <responseFlow>
          <handler type="soapmonitor"/>
        </responseFlow>
           <parameter name="allowedMethods" value="*"/>
           <parameter name="className" value="com.a.b.c.X.Y.ServiceDelegate"/>
    <beanMapping qname="myNS:ABCVo"
      xmlns:myNS="com.a.b.c.vo"
      languageSpecificType="java:com.a.b.c.vo.ABCVo"/>
    </service>
    ServiceDelegate:
    public ABCVo[] getCount(String accessType,long orgId,Date fromDate,Date toDate)
              return ABCVo[];          
    client:
    I place all the stubs in the client app as a jar file. and the code is just like
    ABCVo[] so     =     del.getCount("group",l,calendar,calendar);
    Iam getting the following exception:
    AxisFault
    faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
    faultSubcode:
    faultString: java.lang.ClassCastException: [Ljava.lang.Object;
    faultActor:
    faultNode:
    faultDetail:
    {http://xml.apache.org/axis/}hostname:evoke12
    java.lang.ClassCastException: [Ljava.lang.Object;
    at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder
    .java:222)
    at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.
    java:129)
    at org.apache.axis.encoding.DeserializationContext.endElement(Deserializ
    ationContext.java:1087)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endEleme
    nt(AbstractSAXParser.java:633)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scan
    EndElement(XMLNSDocumentScannerImpl.java:719)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImp
    l$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1685)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImp
    l.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(X
    ML11Configuration.java:834)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(X
    ML11Configuration.java:764)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.
    java:148)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Ab
    stractSAXParser.java:1242)
    at weblogic.xml.jaxp.WebLogicXMLReader.parse(WebLogicXMLReader.java:133)
    at weblogic.xml.jaxp.RegistryXMLReader.parse(RegistryXMLReader.java:153)
    at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
    at org.apache.axis.encoding.DeserializationContext.parse(Deserialization
    Context.java:227)
    at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
    at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
    at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnders
    tandChecker.java:62)
    at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
    at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
    at org.apache.axis.client.Call.invoke(Call.java:2767)
    at org.apache.axis.client.Call.invoke(Call.java:2443)
    at org.apache.axis.client.Call.invoke(Call.java:2366)
    at org.apache.axis.client.Call.invoke(Call.java:1812)
    at com.cscinfo.webservice.client.LmsServiceSoapBindingStub.getSOPCountBy
    NatureOfCase(Unknown Source)
    at com.cscinfo.cscglobal.web.action.EnterCSCGlobalAction.execute(EnterCS
    CGlobalAction.java:68)
    at org.apache.struts.action.RequestProcessor.processActionPerform(Reques
    tProcessor.java:421)
    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.ja
    va:226)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:116
    4)
    at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:397)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run
    (StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecuri
    tyHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.jav
    a:283)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
    va:42)
    at com.cj.trim.trimFilter.doFilter(Unknown Source)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
    va:42)
    at weblogicx.servlet.gzip.filter.GZIPFilter.doFilter(GZIPFilter.java:70)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
    va:42)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
    n.run(WebAppServletContext.java:3229)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
    dSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
    121)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppS
    ervletContext.java:2002)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletC
    ontext.java:1908)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.j
    ava:1362)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)

    It is working for me. See the following configuration.
    <service name="TestService" provider="java:RPC">
         <requestFlow>
              <handler type="soapmonitor"/>
         </requestFlow>
         <responseFlow>
              <handler type="soapmonitor"/>
         </responseFlow>
              <parameter name="allowedMethods" value="*"/>
              <parameter name="className" value="com.xxx.xxx.web.servlet.TestService"/>
              <beanMapping qname="ns:XBeanInfo" xmlns:ns="XBeanInfo" languageSpecificType="java:com.xxx.xxx.web.util.XBeanInfo"/>
         <typeMapping deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
         encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
              qname="myNS:XBeanInfo"
         serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
              xmlns:myNS="urn:TestService"
              type="java:com.xxx.xxx.web.util.XBeanInfo"/>
    </service>

  • Support for xs:date types in web services generated from EJB components

    I need to generate a Web Service from an EJB session bean based upon EJB entities generated from the Oracle 11g database that contain DATE type columns.
    JDeveloper creates java.sql.Timestamp types in the EJB Session bean and this results in an exception error when I try to generate a web service from this bean via webservice annotations:
    java.security.PrivilegedActionException: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions
    java.sql.Timestamp does not have a no-arg default constructor
    I expected the web service wizard to generate argument types xs:dateTime or xs:date so this was an unwelcomed surprise.
    I tried manually adding a method to the session bean with java.util.date arguments and had no problems with the web service wizard that correctly created xs:dateTime arguments. Is there any particular reason why the EJB wizard does not generate java.util.date arguments or handle java.sql.Timestamp without failing with an exception?
    Since I begin with database tables and generate EJB entity classes and then web services with the Jdeveloper wizards it seems to me that there is a problem here in JDeveloper. Would you agree?
    There are several possible more or less appealing workarounds, such as doing manually adding methods to the EJB facade with java.util.date arguments and doing the conversion from/to java.sql.timestamp manually. Is this a reasonable approach or does JDeveloper support date/time for Date columns in some other way that I have missed?
    Very Grateful for any comments or suggestions.
    Edited by: user10601664 on May 2, 2009 1:14 PM
    Edited by: user10601664 on May 2, 2009 1:43 PM

    Checkout this example:
    http://www.manojc.com/?sample3
    public class HelloWorldService{
    * @wlws:exclude
    public void dontExpose(){
    Regards,
    -manoj
    http://manojc.com
    "Jacob Anderson" <[email protected]> wrote in message
    news:4036581e$[email protected]..
    >
    hello,
    I created the descriptor file for a web service that had a protectedmethod in
    it and noticed the protected method showed up in the descriptor file!Should
    the "source2wsdd" task only output PUBLIC methods as service actions? Isthere
    any way to specify methods to be 'ignored' when generating the webservices descriptor
    file?
    here was the generated descriptor XML:
    <web-service name="BindingService"
    protocol="https"
    style="document"
    targetNamespace="http://www.foo.com/ws/BindingService/"
    portName="BindingServicePort"
    uri="/BindingService"
    portTypeName="BindingServicePort">
    <types>
    </types>
    <wsdd:type-mappingxmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:wsdd="http://www.bea.com/servers/wls70">
    <wsdd:type-mapping-entrydeserializer="weblogic.xml.schema.binding.internal.builtin.DocumentCodec"
    type="xsd:anyType"
    class-name="org.w3c.dom.Document"
    serializer="weblogic.xml.schema.binding.internal.builtin.DocumentCodec">
    </wsdd:type-mapping-entry>
    </wsdd:type-mapping>
    <components>
    <java-class name="BindingService"
    class-name="com.arrow.ws.vendor.BindingService">
    </java-class>
    </components>
    <operations>
    <operation name="getConfigName"
    component="BindingService"
    method="getConfigName()">
    <params>
    <return-param xmlns:typeNS="http://www.w3.org/2001/XMLSchema"
    location="body"
    type="typeNS:string"
    name="result"
    class-name="java.lang.String">
    </return-param>
    </params>
    </operation>
    </operations>
    </web-service>

  • Using non_build_in data type in web service

    Hi everybody,
    Can anyone tell me the process of using a data type which is not supported in java web services(data types such as "DATE",...)???
    Any examples can be helpful.
    Thanks in advance

    Hi everybody,
    Can anyone tell me the process of using a data type which is not supported in java web services(data types such as "DATE",...)???
    Any examples can be helpful.
    Thanks in advance

  • Working with timestamp data type.

    Hi all!,
    I have some problems working with the timestamp data type.
    Let's say that i have a table named order, where i store (in two timestamps) the date where the order was made, and the date where the order was executed.
    I want:
    1) first to find the difference between these to timestamps, let me call them a,b,
    2) to find the average time of the difference of timestamps. With that i mean if my table has 60 typles for examples to get (b-a)/60.
    Can these happen?
    Thanks in advance,

    I would do this with a view and a stored procedure within oracle.
    Create a view that contains the two timestamp fields & the difference between them (along with any primary keys from the original table), then use this view in a stored procedure to average the values.

  • Manual WSDL creation with Complex data types

    I'm trying to manually generate a WSDL, for a bpel workflow, so the wsdl constructs do not come from a Java class file, or any of the other normal ways you might generate a WSDL.
    I have successfully created a Definition object from the WSDLFactory, with the code shown below, that appears to be correct, based on reverse engineering of a WS compliant WSDL. The reversed engineered WSDL was created by IONA Artix.
    When I use file WSDLFactoryImpl.WSDLWriterImpl.writeWSDL() to write the WSDL file I get the wsdl:types and wsdl:service definition objectsin the file, but not the wsdl:message, wsdl:portType or wsdl:binding objects.
    The reverse engineered WSDL file has been imported into objects via WSDLReaderImpl, and the resulting Definition object appears correct (based on all system.outs). This definition can be successfully written to file via the same WSDLFactoryImpl.WSDLWriterImpl.writeWSDL(). which results in a correct WSDL file.
    I'm hoping someone can spot my problem.
    Chris Yoerg
    WSDLFactory.java************************************************************************************************
    package com.dralasoft.bpel.util;
    import java.util.*;
    import java.io.*;
    import javax.xml.namespace.QName;
    import javax.xml.parsers.*;
    import javax.wsdl.WSDLException;
    import javax.wsdl.extensions.UnknownExtensibilityElement;
    import org.w3c.dom.*;
    import com.ibm.wsdl.*;
    import com.ibm.wsdl.factory.WSDLFactoryImpl;
    import com.ibm.wsdl.extensions.soap.*;
    /** This class generates a wsdl from scratch
    * the way the namespaces have been left seem to be correct in that the individual
    * porttype, binding and service objects pick up the message parts as seen in the
    * individual system.outs and in the system.out of the definition
    * if you use the tns prefix iteration as seen in the comment out "trial" code
    * you get an error that the tns namespace does not exist in the definition
    * even though it is definitely there
    * the non namespace "trial" code also behaves the same way as this iteration,
    * aka the stuff shows in the definition outputs, but never ends up outputed to
    * file */
    //import com.dralasoft.bpel.BPELWorkflow;
    public class WSDLFactory {
    public WSDLFactory() {
    public void makeWorkflowWSDL(){
    WSDLFactoryImpl factory = null;
    Constants constants = new Constants();
    SOAPConstants soapconstants = new SOAPConstants();
    try {
    factory = (WSDLFactoryImpl) WSDLFactoryImpl.newInstance();
    catch (WSDLException we) {
    System.out.println("wsdl excepiotn " + we.getMessage());
    // get a new definition from the factory
    DefinitionImpl definition = (DefinitionImpl) factory.newDefinition();
    // add target namespace and additional namespaces that might be there
    definition.setTargetNamespace("http://www.yoerg.net");
    definition.addNamespace("tns", "http://www.yoerg.net");
    definition.addNamespace("soap", "http://schemas.xmlsoap.org/wsdl/soap/");
    definition.addNamespace("xsd", "http://www.w3.org/2001/XMLSchema");
    definition.addNamespace("wsdl", "http://schemas.xmlsoap.org/wsdl/");
    // added for generic purposes
    definition.addNamespace("xsi", "http://www.w3.org/2001/XMLSchema-instance");
    // specify the service name
    QName qname = new QName("http://www.yoerg.net",
    "PurchaseOrderProcess");
    definition.setQName(qname);
    // create types **********************************************************
    TypesImpl types = (TypesImpl) definition.createTypes();
    // generate a schema in DOM to set into the types object
    javax.xml.parsers.DocumentBuilderFactory domfactory =
    javax.xml.parsers.DocumentBuilderFactory.newInstance();
    javax.xml.parsers.DocumentBuilder builder = null;
    try {
    builder = domfactory.newDocumentBuilder();
    catch (javax.xml.parsers.ParserConfigurationException pce) {
    System.out.println("parser config exception " + pce.getMessage());
    DOMImplementation dImpl = builder.getDOMImplementation();
    // namespace for the schema
    String namespaceURI = "http://www.w3.org/2001/XMLSchema";
    Document doc = dImpl.createDocument(namespaceURI, "schema", null);
    Element schema = doc.getDocumentElement();
    //schema.setPrefix("xsd");
    schema.setAttribute("xmlns", "http://www.w3.org/2001/XMLSchema");
    schema.setAttribute("targetNamespace", "http://www.yoerg.net");
    //set other namespaces on schema
    // this doesn't make it into the schema at final save, because there
    // are no wsdl elements inside the box
    schema.setAttribute("xmlns:wsdl", "http://schemas.xmlsoap.org/wsdl/");
    // this is not needed
    schema.setAttribute("tns", "http://www.yoerg.net");
    Element first = doc.createElement("element");
    first.setAttribute("name", "sendPurchaseOrder");
    first.setAttribute("type", "tns:sendPORequest");
    schema.appendChild(first);
    Element fourth = doc.createElement("element");
    fourth.setAttribute("name", "sendSchedule");
    fourth.setAttribute("type", "tns:sendScheduleRequest");
    schema.appendChild(fourth);
    Element fifth = doc.createElement("element");
    fifth.setAttribute("name", "sendInvoice");
    fifth.setAttribute("type", "tns:sendInvoiceRequest");
    schema.appendChild(fifth);
    // now add correlations
    Element corfirst = doc.createElement("element");
    corfirst.setAttribute("name", "correlations");
    corfirst.setAttribute("type", "tns:correlationset");
    schema.appendChild(corfirst);
    Element second = doc.createElement("element");
    second.setAttribute("name", "portType");
    second.setAttribute("type", "xsd:string");
    schema.appendChild(second);
    Element third = doc.createElement("element");
    third.setAttribute("name", "partnerLink");
    third.setAttribute("type", "xsd:string");
    schema.appendChild(third);
    // sequence element thats used over and over
    Element sequence = null;
    Element sixth = doc.createElement("complexType");
    sixth.setAttribute("name", "sendPORequest");
    sequence = doc.createElement("sequence");
    Element part1 = doc.createElement("element");
    part1.setAttribute("name", "customerId");
    part1.setAttribute("type", "xsd:long");
    sequence.appendChild(part1);
    Element part2 = doc.createElement("element");
    part2.setAttribute("name", "purchaseOrderNumber");
    part2.setAttribute("type", "xsd:long");
    sequence.appendChild(part2);
    Element part3 = doc.createElement("element");
    part3.setAttribute("name", "productId");
    part3.setAttribute("type", "xsd:long");
    sequence.appendChild(part3);
    Element part4 = doc.createElement("element");
    part4.setAttribute("name", "quantity");
    part4.setAttribute("type", "xsd:int");
    sequence.appendChild(part4);
    sixth.appendChild(sequence);
    schema.appendChild(sixth);
    Element seventh = doc.createElement("complexType");
    seventh.setAttribute("name", "sendScheduleRequest");
    sequence = doc.createElement("sequence");
    Element part6 = doc.createElement("element");
    part6.setAttribute("name", "shipDate");
    part6.setAttribute("type", "xsd:dateTime");
    sequence.appendChild(part6);
    Element part7 = doc.createElement("element");
    part7.setAttribute("name", "customerId");
    part7.setAttribute("type", "xsd:long");
    sequence.appendChild(part7);
    Element part8 = doc.createElement("element");
    part8.setAttribute("name", "purchaseOrderNumber");
    part8.setAttribute("type", "xsd:long");
    sequence.appendChild(part8);
    seventh.appendChild(sequence);
    schema.appendChild(seventh);
    Element eighth = doc.createElement("complexType");
    eighth.setAttribute("name", "sendInvoiceRequest");
    sequence = doc.createElement("sequence");
    Element part5 = doc.createElement("element");
    part5.setAttribute("name", "price");
    part5.setAttribute("type", "xsd:double");
    sequence.appendChild(part5);
    Element part9 = doc.createElement("element");
    part9.setAttribute("name", "customerId");
    part9.setAttribute("type", "xsd:long");
    sequence.appendChild(part9);
    Element part10 = doc.createElement("element");
    part10.setAttribute("name", "purchaseOrderNumber");
    part10.setAttribute("type", "xsd:long");
    sequence.appendChild(part10);
    eighth.appendChild(sequence);
    schema.appendChild(eighth);
    Element ninth = doc.createElement("complexType");
    ninth.setAttribute("name", "correlationset");
    sequence = doc.createElement("sequence");
    Element part11 = doc.createElement("element");
    part11.setAttribute("name", "PurchaseOrder");
    part11.setAttribute("type", "tns:correlationsetvalues");
    sequence.appendChild(part11);
    ninth.appendChild(sequence);
    schema.appendChild(ninth);
    Element tenth = doc.createElement("complexType");
    tenth.setAttribute("name", "correlationsetvalues");
    sequence = doc.createElement("sequence");
    Element part12 = doc.createElement("element");
    part12.setAttribute("name", "PurchaseOrderNumber");
    part12.setAttribute("type", "xsd:string");
    sequence.appendChild(part12);
    Element part13 = doc.createElement("element");
    part13.setAttribute("name", "customerID");
    part13.setAttribute("type", "xsd:string");
    sequence.appendChild(part13);
    tenth.appendChild(sequence);
    schema.appendChild(tenth);
    // show the schema w3c element via conversion JDOM Element and coversion to string
    org.jdom.input.DOMBuilder jdbuilder = new org.jdom.input.DOMBuilder();
    org.jdom.Element jelement = jdbuilder.build(schema);
    //System.out.println("\njelement " + jelement);
    org.jdom.output.XMLOutputter xmloutput = new org.jdom.output.XMLOutputter();
    xmloutput.setIndent(" ");
    xmloutput.setNewlines(true);
    xmloutput.setTrimAllWhite(true);
    xmloutput.setTextTrim(true);
    xmloutput.setEncoding("ISO-8859-1");
    String strelement = xmloutput.outputString(jelement);
    System.out.println("schema in jdom = \n " + strelement);
    UnknownExtensibilityElement extel = new UnknownExtensibilityElement();
    extel.setElement(schema);
    extel.setElementType(new QName(Constants.Q_ELEM_XSD_2001.getNamespaceURI(),
    schema.getLocalName()));
    types.addExtensibilityElement(extel);
    // the above is preferrable to this
    //types.setDocumentationElement(schema);
    //System.out.println("schema " + schema);
    // and set the types definiton back to the definition object
    definition.setTypes(types);
    // these lines all show null or empty on system.out.println
    //System.out.println("\ntypes " + types);
    // end of setting the types
    // add the messages*******************************************************
    MessageImpl message1 = (MessageImpl)definition.createMessage();
    QName messageqname= new QName("http://www.yoerg.net", "newMessage");
    message1.setQName(messageqname);
    PartImpl partma = (PartImpl)definition.createPart();
    partma.setName("sendPurchaseOrderBody");
    partma.setElementName(new QName("http://www.yoerg.net", "sendPurchaseOrder"));
    message1.addPart(partma);
    partma = (PartImpl)definition.createPart();
    partma.setName("correlationsBody");
    partma.setElementName(new QName("http://www.yoerg.net", "correlations"));
    message1.addPart(partma);
    partma = (PartImpl)definition.createPart();
    partma.setName("portTypeBody");
    partma.setElementName(new QName("http://www.yoerg.net", "portType"));
    message1.addPart(partma);
    partma = (PartImpl)definition.createPart();
    partma.setName("partnerLinkBody");
    partma.setElementName(new QName("http://www.yoerg.net", "partnerLink"));
    message1.addPart(partma);
    definition.addMessage(message1);
    // create new blank message for response, with no parts
    MessageImpl message2 = (MessageImpl)definition.createMessage();
    QName messageqname2= new QName("http://www.yoerg.net", "sendPurchaseOrderResponseMessage");
    message2.setQName(messageqname2);
    definition.addMessage(message2);
    System.out.println("\nmessage1 " + message1);
    System.out.println("\nmessage2 " + message2);
    //Map map = message.getParts();
    //Element mes = message.getDocumentationElement();
    //System.out.println("\nmessage map = " + map);
    // done adding messages
    // add the porttypes******************************************************
    PortTypeImpl porttype = (PortTypeImpl)definition.createPortType();
    porttype.setQName(new QName("http://www.yoerg.net", "purchaseOrderPortType"));
    OperationImpl operation = (OperationImpl)definition.createOperation();
    operation.setName("sendMyPurchaseOrder");
    operation.setStyle(javax.wsdl.OperationType.REQUEST_RESPONSE);
    InputImpl input = (InputImpl)definition.createInput();
    input.setName("sendPurchaseOrderRequest");
    input.setMessage(message1);
    operation.setInput(input);
    OutputImpl output = (OutputImpl)definition.createOutput();
    output.setName("sendPurchaseOrderResponse");
    output.setMessage(message2);
    operation.setOutput(output);
    porttype.addOperation(operation);
    System.out.println("\nporttype " + porttype);
    definition.addPortType(porttype);
    // done adding the porttypes
    // add the bindings*******************************************************
    BindingImpl binding = (BindingImpl)definition.createBinding();
    binding.setQName(new QName("http://www.yoerg.net",
    "purchaseOrderSOAPBinding"));
    binding.setPortType(porttype);
    SOAPBindingImpl bindingextension = new SOAPBindingImpl();
    bindingextension.setStyle("document");
    bindingextension.setTransportURI("http://schemas.xmlsoap.org/soap/http");
    //System.out.println("binding extension " + bindingextension);
    binding.addExtensibilityElement(bindingextension);
    BindingOperationImpl bindingoperation
    = (BindingOperationImpl)definition.createBindingOperation();
    bindingoperation.setName("sendMyPurchaseOrder");
    bindingoperation.setOperation(operation);
    // this is not present in the Imported correct version, and these lines of code
    // are not necessary, but they also do not hurt or help
    //SOAPOperationImpl operationextension = new SOAPOperationImpl();
    //operationextension.setStyle("document");
    //operationextension.setSoapActionURI("");
    ///////operationextension.setElementType(new QName("http://www.yoerg.net", "ListenerService"));
    //operationextension.setRequired(new Boolean(true));
    //bindingoperation.addExtensibilityElement(operationextension);
    BindingInputImpl bindinginput
    = (BindingInputImpl)definition.createBindingInput();
    bindinginput.setName("sendPurchaseOrderRequest");
    SOAPBodyImpl inputextension = new SOAPBodyImpl();
    inputextension.setUse("literal");
    inputextension.setRequired(new Boolean(true));
    inputextension.setNamespaceURI("http://www.yoerg.net");
    bindinginput.addExtensibilityElement(inputextension);
    //System.out.println("\ninputextension " + inputextension);
    bindingoperation.setBindingInput(bindinginput);
    BindingOutputImpl bindingoutput
    = (BindingOutputImpl)definition.createBindingOutput();
    bindingoutput.setName("sendPurchaseOrderResponse");
    SOAPBodyImpl outputextension = new SOAPBodyImpl();
    outputextension.setUse("literal");
    outputextension.setRequired(new Boolean(true));
    outputextension.setNamespaceURI("http://www.yoerg.net");
    bindingoutput.addExtensibilityElement(outputextension);
    //System.out.println("\noutputextension " + outputextension);
    bindingoperation.setBindingOutput(bindingoutput);
    binding.addBindingOperation(bindingoperation);
    System.out.println("\nbinding " + binding);
    definition.addBinding(binding);
    // done adding binding
    // adding service*********************************************************
    ServiceImpl service = (ServiceImpl)definition.createService();
    service.setQName(new QName("http://www.yoerg.net",
    "ListenerServiceService"));
    PortImpl port = (PortImpl)definition.createPort();
    port.setBinding(binding);
    port.setName("ListenerService");
    SOAPAddressImpl soapaddress = new SOAPAddressImpl();
    soapaddress
    .setLocationURI("http://localhost:8080/axis/services/ListenerService");
    port.addExtensibilityElement(soapaddress);
    service.addPort(port);
    definition.addService(service);
    System.out.println("\nService " + service);
    // done adding service
    // print def object, and you will see all objects, except types
    System.out.println("\ndefinition \n" + definition);
    // output to file, just like we would in bpel workflow environment
    com.ibm.wsdl.xml.WSDLWriterImpl writer
    = (com.ibm.wsdl.xml.WSDLWriterImpl)factory.newWSDLWriter();
    File file = new File("c:\\chris\\w.wsdl");
    FileOutputStream out = null;
    // this has been proven to be correct
    try{
    out = new FileOutputStream(file);
    writer.writeWSDL(definition, out);
    catch(FileNotFoundException fnfe){
    System.out.println("file not found " + fnfe.getMessage());
    catch(IOException ioe){
    System.out.println("file not found " + ioe.getMessage());
    catch(javax.wsdl.WSDLException we){
    System.out.println("wsdl exception " + we.getMessage());
    // now bring it back in just for fun
    FileInputStream in = null;
    byte[] inputfile = null;
    org.jdom.Document jdocument = null;
    try{
    in = new FileInputStream(file);
    inputfile = new byte[in.available()];
    in.read(inputfile, 0, in.available());
    org.jdom.input.SAXBuilder jdombuilder = new org.jdom.input.SAXBuilder();
    ByteArrayInputStream byteinput = new ByteArrayInputStream(inputfile);
    jdocument = jdombuilder.build(byteinput);
    catch(FileNotFoundException fnfe){
    System.out.println("file not found " + fnfe.getMessage());
    catch(org.jdom.JDOMException jde){
    System.out.println("jdom exception " + jde.getMessage());
    catch(IOException ioe){
    System.out.println("io exception " + ioe.getMessage());
    String strdocument = xmloutput.outputString(jdocument);
    System.out.println("\nJDOM beautified version \n" + strdocument);
    public static void main(String[] args){
    WSDLFactory factory = new WSDLFactory();
    factory.makeWorkflowWSDL();
    End ofWSDLFactory.java*********************************************************************
    Desired WSDL output to file******************************************************************
    <?xml version="1.0" encoding="UTF-8"?>
    <definitions name="PurchaseOrderProcess" targetNamespace="http://www.yoerg.net"
    xmlns="http://schemas.xmlsoap.org/wsdl/"
    xmlns:http-conf="http://schemas.iona.com/transports/http/configuration"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:tns="http://www.yoerg.net" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <types>
    <schema targetNamespace="http://www.yoerg.net"
    xmlns="http://www.w3.org/2001/XMLSchema"
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
    <element name="sendPurchaseOrder" type="tns:sendPORequest"/>
    <element name="correlations" type="tns:correlationset"/>
    <element name="portType" type="xsd:string"/>
    <element name="partnerLink" type="xsd:string"/>
    <element name="sendSchedule" type="tns:sendScheduleRequest"/>
    <element name="sendInvoice" type="tns:sendInvoiceRequest"/>
    <complexType name="correlationsetvalues">
    <sequence>
    <element name="PurchaseOrderNumber" type="xsd:string"/>
    <element name="customerID" type="xsd:string"/>
    </sequence>
    </complexType>
    <complexType name="correlationset">
    <sequence>
    <element name="PurchaseOrder" type="tns:correlationsetvalues"/>
    </sequence>
    </complexType>
    <complexType name="sendPORequest">
    <sequence>
    <element name="customerId" type="xsd:long"/>
    <element name="purchaseOrderNumber" type="xsd:long"/>
    <element name="productId" type="xsd:long"/>
    <element name="quantity" type="xsd:int"/>
    </sequence>
    </complexType>
    <complexType name="sendScheduleRequest">
    <sequence>
    <element name="shipDate" type="xsd:dateTime"/>
    <element name="customerId" type="xsd:long"/>
    <element name="purchaseOrderNumber" type="xsd:long"/>
    </sequence>
    </complexType>
    <complexType name="sendInvoiceRequest">
    <sequence>
    <element name="price" type="xsd:double"/>
    <element name="customerId" type="xsd:long"/>
    <element name="purchaseOrderNumber" type="xsd:long"/>
    </sequence>
    </complexType>
    </schema>
    </types>
    <message name="newMessage">
    <part element="tns:sendPurchaseOrder" name="sendPurchaseOrderBody"/>
    <part element="tns:correlations" name="correlationsBody"/>
    <part element="tns:portType" name="portTypeBody"/>
    <part element="tns:partnerLink" name="partnerLinkBody"/>
    </message>
    <message name="sendPurchaseOrderResponseMessage"/>
    <message name="sendScheduleRequestMessage">
    <part element="tns:sendSchedule" name="sendScheduleBody"/>
    <part element="tns:correlations" name="correlationBody"/>
    <part element="tns:portType" name="portTypeBody"/>
    <part element="tns:partnerLink" name="partnerLinkBody"/>
    </message>
    <message name="sendInvoiceRequestMessage">
    <part element="tns:sendInvoice" name="sendInvoiceBody"/>
    <part element="tns:correlations" name="correlationsBody"/>
    <part element="tns:portType" name="portTypeBody"/>
    <part element="tns:partnerLink" name="partnerLinkBody"/>
    </message>
    <portType name="purchaseOrderPortType">
    <operation name="sendMyPurchaseOrder">
    <input message="tns:newMessage" name="sendPurchaseOrderRequest"/>
    <output message="tns:sendPurchaseOrderResponseMessage"
    name="sendPurchaseOrderResponse"/>
    </operation>
    <operation name="sendMySchedule">
    <input message="tns:sendScheduleRequestMessage" name="sendMySchedule"/>
    </operation>
    <operation name="sendInvoice">
    <input message="tns:sendInvoiceRequestMessage" name="sendInvoice"/>
    </operation>
    </portType>
    <binding name="purchaseOrderSOAPBinding" type="tns:purchaseOrderPortType">
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
    <operation name="sendMyPurchaseOrder">
    <soap:operation soapAction="" style="document"/>
    <input name="sendPurchaseOrderRequest">
    <soap:body use="literal"/>
    </input>
    <output name="sendPurchaseOrderResponse">
    <soap:body use="literal"/>
    </output>
    </operation>
    <operation name="sendMySchedule">
    <soap:operation soapAction="" style="document"/>
    <input name="sendMySchedule">
    <soap:body use="literal"/>
    </input>
    </operation>
    <operation name="sendInvoice">
    <soap:operation soapAction="" style="document"/>
    <input name="sendInvoice">
    <soap:body use="literal"/>
    </input>
    </operation>
    </binding>
    <service name="ListenerServiceService">
    <port binding="tns:purchaseOrderSOAPBinding" name="ListenerService">
    <soap:address location="http://localhost:8080/axis/services/ListenerService"/>
    <http-conf:client/>
    <http-conf:server/>
    </port>
    </service>
    </definitions>
    End of desired WSDL*************************************************************************************

    Adding these statements solved the problem
    message1.setUndefined(false);
    message2.setUndefined(false);
    binding.setUndefined(false);
    operation.setUndefined(false);
    porttype.setUndefined(false);
    This is kind of weird because you explicitly define them thru API calls, and this call seems redundant.
    Chris Yoerg

Maybe you are looking for

  • Maximum size for Elements 6.0 catalog

    Is there a maximum size for a singular catalog to keep it operating efficiently?  Everything I read is that the maximum size is dependent on your hard drive space.  I recently had to restore everything from a backup due to a fatal crash.  I keep my p

  • Iwork 09 dvd bought not in appstore overview

    I bought a couple of years ago the DVD of Iwork 09. After installing this program, the three programs, pages, numbers and keynote were displayed in my programs. With the new OSx there should be a update of pages ( and the others ) to 4.2, but when i

  • Installing archive version on MAC 10.4.11Tiger

    Can anyone explain "STOP"Unable to unarchive"fp_10.3.183.11_archive zip" into desktop.(Error 1-operation not permitted) " on my MAC 10.4 while trying to install this fp archive after using the uninstall download provided by Adobe?

  • Network error: Unable to lookup host names

    on one client running the cisco any connect, It is unable to connect and keeps giving an error Network error: Unable to lookup host names. any idea about this?

  • Crash during firmware upgrd

    I've just been performing software updates to my Mac. When I restarted my machine to update the Firmware software my machine crashed. When I try to do a restart all I get is a blank screen. Can anyone give some ideas of what to do?