Brian,

Thanks for your response, it was correct for the symptom I was seeing at the time. It 
did get me thinking and finally on the right path. As it turns out, Reporting Services 
defines a SessionHeader Message it uses to track sessioning. One can get at it via:

            proxy.render(path                    /* report */,
                         format                  /* format */,
                         historyId               /* historyID */,
                         deviceInfo              /* deviceInfo */,
                         parameters              /* parameters */,
                         credentials             /* credentials */,
                         showHideToggle          /* showHideToggle */,
                         result                  /* result */,
                         encoding                /* encoding */,
                         mimeType                /* mimeType */,
                         reportHistoryParameters /* parametersUsed */,
                         warnings                /* warnings */,
                         streamIds               /* streamIds */
                );

            // pull the returned SessionHeader and save it for any potential images in 
the page.
            org.apache.axis.client.Call          lastCall = 
((org.apache.axis.client.Service) locator).getCall();
            org.apache.axis.message.SOAPEnvelope envelope = 
lastCall.getResponseMessage().getSOAPEnvelope();
            sessionHeader = 
envelope.getHeaderByName("http://schemas.microsoft.com/sqlserver/2003/12/reporting/reportingservices";,
 "SessionHeader");

and then before calling renderStream(), which requires the session to be set:


            org.apache.axis.client.Stub stub = (org.apache.axis.client.Stub) proxy;

            stub.setHeader(getSessionHeader());
            proxy.renderStream(path                    /* report */,
                               format                  /* format */,
                               imageID                 /* streamID */,
                               historyId               /* historyID */,
                               deviceInfo              /* deviceInfo */,
                               parameters              /* parameters */,
                               result                  /* result */,
                               encoding                /* encoding */,
                               mimeType                /* mimeType */
                );
            if (DEBUG) 
System.err.println("MSSQLReportingServices.getReportStream():\n" +
                                          "\tencoding = " + encoding.value + "\n" +
                                          "\tmimeType = " + mimeType.value + "\n"
                );
            response.setContentType(mimeType.value);
            ServletOutputStream os = response.getOutputStream();
            os.write(result.value, 0, result.value.length);
            os.flush();
            os.close();

note: getSessionHeader() simply returns the value of sessionHeader that I saved off 
above.


The key was finding the answer to "Q: How do I get response headers when using 
WSDL2Java stubs?" in the wiki. Thanks to the author!

I'm glad to finally be past this one!

-brian

-----Original Message-----
From: Brian Drake [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 28, 2004 8:37 AM
To: [EMAIL PROTECTED]
Cc: Brian Freeman
Subject: RE: Microsoft Reporting Services sessioning /
SimpleSessionHandler


Brian,

It looks like you're not specifying a deserializer for your CatalogItems array.
I'm pretty new with Axis myself, but I've done something quite similar to what
it appears you're trying to do, and I've run into the same exception a couple
times.

Try putting a bit of code similar to this under the <service> tag in your
wsdd...

    <typeMapping qname="myNS:ArrayOfCase" xmlns:myNS="CMCase" 
                 type="java:com.ghx.caseManagement.model.cases.Case[]"
                 serializer="org.apache.axis.encoding.ser.ArraySerializerFactory"
                 deserializer="org.apache.axis.encoding.ser.ArrayDeserializerFactory"/>

In this case, <typeMapping> is a generalized version of <beanMapping>.  The
org.apache.axis.encoding.ser.* classes are a bunch of serializers and deserializers.
You can pick the one that makes the most sense (BeanSerializerFactory, for example,
if you're passing beans to your service, which is a pretty common approach).  In 
the above case, of course, I am passing an array.  Change the namespace (myNS)
to your service name ("ReportingServiceSoap").

In the example above, I am returning the array from the service method.  So I
need to put something in my delegate (client) code to handle it as well...

      call.registerTypeMapping(Case[].class, qn,
          new org.apache.axis.encoding.ser.ArraySerializerFactory(),        
          new org.apache.axis.encoding.ser.ArrayDeserializerFactory());     
      call.setReturnType(qn); 

Give that a whirl and see what shakes out.

-BWD.

-----Original Message-----
From: Brian Freeman [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 27, 2004 9:17 PM
To: Axis-User (E-mail)
Subject: Microsoft Reporting Services sessioning / SimpleSessionHandler


Hi all!

I'm new to Axis and have been working with getting a Microsoft Reporting Services 
client working. I've gotten through our NTML authentication issues with talking to 
Reporting Services and am stuck on getting the sessioning operational.

Several threads I've seen refer to using SimpleSessionHandler and I've added the 
following to client-config.wsdd


  <handler name="session" type="java:org.apache.axis.handlers.SimpleSessionHandler"/>
  <service name="ReportingServiceSoap" provider="java:RPC" style="rpc" use="encoded">
      <requestFlow>
        <handler type="session"/>
      </requestFlow>
      <responseFlow>
        <handler type="session"/>
      </responseFlow>
      <parameter name="wsdlTargetNamespace" 
value="http://schemas.microsoft.com/sqlserver/2003/12/reporting/reportingservices"/>
      <parameter name="wsdlServiceElement"  value="ReportingService"/>
      <parameter name="wsdlServicePort"     value="ReportingServiceSoap"/>
      <parameter name="className"           
value="com.microsoft.schemas.sqlserver._2003._12.reporting.reportingservices.ReportingServiceSoap"/>
      <parameter name="wsdlPortType"        value="ReportingServiceSoap"/>
      <parameter name="allowedMethods"      value="*"/>
      <parameter name="scope"               value="Session"/>
  </service>

but I'm getting faults on code that was previously working and obviously don't have 
the above block correct. 

AxisFault faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException 
faultSubcode: faultString: org.xml.sax.SAXException: Deserializing parameter 
&apos;CatalogItems&apos;: could not find deserializer for type 
{http://schemas.microsoft.com/sqlserver/2003/12/reporting/reportingservices}ArrayOfCatalogItem
 faultActor: faultNode: faultDetail: {http://xml.apache.org/axis/}stackTrace: 
org.xml.sax.SAXException: Deserializing parameter 'CatalogItems': could not find 
deserializer for type 
{http://schemas.microsoft.com/sqlserver/2003/12/reporting/reportingservices}ArrayOfCatalogItem
 at org.apache.axis.message.RPCHandler.onStartChild(RPCHandler.java:302) at 
org.apache.axis.encoding.DeserializationContextImpl.startElement(DeserializationContextImpl.java:963)
 at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:198) at 
org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:722) at 
org.apache.axis.message.RPCElement.deserialize(RPCElement.java:233) at 
org.apache.axis.message.RPCElement.getParams(RPCElement.java:347) at 
org.apache.axis.client.Call.invoke(Call.java:2272) at 
org.apache.axis.client.Call.invoke(Call.java:2171) at 
org.apache.axis.client.Call.invoke(Call.java:1691) at 
com.microsoft.schemas.sqlserver._2003._12.reporting.reportingservices.ReportingServiceSoapStub.listChildren(ReportingServiceSoapStub.java:1916)
 
...

Has anyone already done this/any ideas where I can look for information about these 
wsdl* parameters and what I'm missing? 

The approach I'm on, is:
- add SimpleSessionHandler into client-config.wsdd
- add SimpleSessionHandler into my stub
- set _call.setClientHandlers() to the created SimpleSessionHandler in my client
and pray that it works ;)
Does that sound right?
Thanks,
Brian


Reply via email to