Grails-Plugin-Consortium / grails-cxf

CXF Plugin for the Grails web framework
http://grails.org/plugin/cxf
38 stars 46 forks source link

Does not match an operation #28

Closed gcstang closed 9 years ago

gcstang commented 11 years ago

Previous Issue: Upgrade from 0.7.0 to 1.1.0, WSDL no longer shows fields or complex types just the main service

Thank you for your previous help, I have the wsdl almost identical to the older version but when I regenerate the client objects and peform a test that did work I now get:

When calling: GetTaxcalcResponseDocument response = stub.getTaxcalc(getTaxDoc);

org.apache.axis2.AxisFault: The given SOAPAction http://my.package.com/TaxcalcService/getTaxcalc does not match an operation.

I'm on grails 2.2.1 using GGTS if it helps. When I got to my http://localhost:8080/Test1/services/ I can see getTaxcalc and Endpoint address: http://localhost:8080/Test1/services/taxcalc WSDL : {http://my.package.com/}TaxcalcServiceService Target namespace: http://my.package.com/

ctoestreich commented 11 years ago

Without more code, hard to tell. You may want to consider trying renaming the end point to something other than get maybe calculateTax. Slight chance that Groovy/Grails is treating the get prefix as a property.

gcstang commented 11 years ago

That didn't work would you like me to send you some code in an archive like rar or zip?

On Mon, Mar 18, 2013 at 8:35 AM, Christian Oestreich < notifications@github.com> wrote:

Without more code, hard to tell. You may want to consider trying renaming the end point to something other than get maybe calculateTax. Slight chance that Groovy/Grails is treating the get prefix as a property.

— Reply to this email directly or view it on GitHubhttps://github.com/thorstadt/grails-cxf/issues/28#issuecomment-15054773 .

ctoestreich commented 11 years ago

A zip would be fine. I can look at it today or tomorrow. acetrike at gmail

ctoestreich commented 11 years ago

I have added your domain classes and service to the test project https://github.com/ctoestreich/grails-cxf-tax-project-test

I wrote a functional spec that is passing just fine as well as added an additional soap ui project under docs/taxcalc-wsdl-soapui-project.xml

The operation is working just fine over both soap and the functional test. If something else is broken please provide some detailed commentary on the exact problem of what the expectation vs realty is as I can not seem to reproduce what I understand the issue to be from your comments.

gcstang commented 11 years ago

Your project or mine I get this when using SoapUI

soap:Body soap:Fault soap:Client Unmarshalling Error: 1 /soap:Fault /soap:Body /soap:Envelope On Thu, Mar 21, 2013 at 11:17 AM, Christian Oestreich < notifications@github.com> wrote: > I have added your domain classes and service to the test project > https://github.com/ctoestreich/grails-cxf-tax-project-test > > I wrote a functional spec that is passing just fine as well as added an > additional soap ui project under docs/taxcalc-wsdl-soapui-project.xml > > The operation is working just fine over both soap and the functional test. > If something else is broken please provide some detailed commentary on the > exact problem of what the expectation vs realty is as I can not seem to > reproduce what I understand the issue to be from your comments. > > — > Reply to this email directly or view it on GitHubhttps://github.com/thorstadt/grails-cxf/issues/28#issuecomment-15248531 > .
ctoestreich commented 11 years ago

Can you change the values of the test request so you can narrow down the field. make all that are 1 sequencial like 1,2,3,4 so you can pinpoint the field. Let me know which it is.

ctoestreich commented 11 years ago

What happens when running test-app on my project I provided?

gcstang commented 11 years ago

I'll try to narrow it down but when I run your app in test it passes.

Running 1 spock test... 1 of 1 | Completed 1 spock test, 0 failed in 2247ms | Tests PASSED - view reports in D:\GitRepositories\grails-cxf-tax-project-test\target\test-reports

On Thu, Mar 21, 2013 at 2:09 PM, Christian Oestreich < notifications@github.com> wrote:

What happens when running test-app on my project I provided?

— Reply to this email directly or view it on GitHubhttps://github.com/thorstadt/grails-cxf/issues/28#issuecomment-15259178 .

gcstang commented 11 years ago

Ok it was my version field, I'm past that now and receiving this error:

From SOAP Response: null id in com.oursite.webservice.TaxCalculationRequestLineItem entry (don't flush the Session after an exception occurs)

I'm guessing there is an issue with this line that is causing the problem: 96 | retrievePlus4 in com.oursite.taxcalc.TaxProcessingService

This is the code from that line: def retrievePlus4(String zip, String zipp4) { log.debug "Finding By Zip : "+zip def c = CCH_ZipPlus4.createCriteria() def results = c { eq("zip", zip) and { le("plus4Lo", zipp4) } and { ge("plus4Hi", zipp4) } maxResults(1) order("plus4Lo", "asc") } if(log.isDebugEnabled()) { if(results != null) { results.each { log.debug "Low: "+ it.plus4Lo + " High: " + it.plus4Hi } } } if(log.isDebugEnabled()) { if(results == null) { log.debug "plus4 NOT found" } } return results }

From GGTS 3.2.0 Console: | Error 2013-03-21 15:28:59,188 [http-bio-8080-exec-5] ERROR hibernate.AssertionFailure - an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session) Message: null id in com.oursite.webservice.TaxCalculationRequestLineItem entry (don't flush the Session after an exception occurs) Line | Method ->> 1616 | invokeMethod in grails.orm.HibernateCriteriaBuilder


| 96 | retrievePlus4 in com.oursite.taxcalc.TaxProcessingService | 237 | calculateTaxes . in com.oursite.taxcalc.TaxCalculationService$$EO0kpa99 | 514 | processTaxRequest in com.oursite.taxcalc.TaxProcessingService | 21 | calculateTax . . in com.oursite.soap.TaxcalcService | 180 | performInvocation in org.apache.cxf.service.invoker.AbstractInvoker | 96 | invoke . . . . . in '' | 178 | invoke in org.apache.cxf.jaxws.AbstractJAXWSMethodInvoker | 64 | invoke . . . . . in org.apache.cxf.jaxws.JAXWSMethodInvoker | 75 | invoke in org.apache.cxf.service.invoker.AbstractInvoker | 58 | run . . . . . . . in org.apache.cxf.interceptor.ServiceInvokerInterceptor$1 | 471 | call in java.util.concurrent.Executors$RunnableAdapter | 334 | innerRun . . . . in java.util.concurrent.FutureTask$Sync | 166 | run in java.util.concurrent.FutureTask | 37 | execute . . . . . in org.apache.cxf.workqueue.SynchronousExecutor | 107 | handleMessage in org.apache.cxf.interceptor.ServiceInvokerInterceptor | 262 | doIntercept . . . in org.apache.cxf.phase.PhaseInterceptorChain | 121 | onMessage in org.apache.cxf.transport.ChainInitiationObserver | 211 | invoke . . . . . in org.apache.cxf.transport.http.AbstractHTTPDestination | 213 | invokeDestination in org.apache.cxf.transport.servlet.ServletController | 193 | invoke . . . . . in '' | 130 | invoke in org.apache.cxf.transport.servlet.CXFNonSpringServlet | 221 | handleRequest . . in org.apache.cxf.transport.servlet.AbstractHTTPServlet | 141 | doPost in '' | 197 | service . . . . . in '' | 46 | doFilterInternal in org.grails.jaxrs.web.JaxrsFilter | 1145 | runWorker . . . . in java.util.concurrent.ThreadPoolExecutor | 615 | run in java.util.concurrent.ThreadPoolExecutor$Worker ^ 722 | run . . . . . . . in java.lang.Thread

Is there a reason you prefixed all your domain packages with "grails." ?

Thank you for your help.

On Thu, Mar 21, 2013 at 2:45 PM, G C gcstang@hotmail.com wrote:

I'll try to narrow it down but when I run your app in test it passes.

Running 1 spock test... 1 of 1 | Completed 1 spock test, 0 failed in 2247ms | Tests PASSED - view reports in D:\GitRepositories\grails-cxf-tax-project-test\target\test-reports

On Thu, Mar 21, 2013 at 2:09 PM, Christian Oestreich < notifications@github.com> wrote:

What happens when running test-app on my project I provided?

— Reply to this email directly or view it on GitHubhttps://github.com/thorstadt/grails-cxf/issues/28#issuecomment-15259178 .

ctoestreich commented 11 years ago

I can't really tell you the issue without debugging the code directly, but what I will say is that using Domain objects as service method in/out params can cause side effects like this to occur since you are dealing with unbound/non-persisted instances of domain classes. I don't specifically see where you are using the tax line item in the code above so it might be up the stack a bit, but there will not be an ID on that object since it is essentially just a POGO at that point. If you don't need to persist the in/out you may want to consider moving them into src/groovy and making them simple POGOs and then map to domain classes when you need to persist.

You certainly CAN use domain classes, but when you receive a request you may want to call .save() on it so all the objects have IDs/version/etc. Also before sending a response you would need to call .save() on it or it will always have id/version/etc as 0/null since it isn't a persisted object.

If you are using domain objects simply for constraints there is a @Validatable annotation you can put on POGOs and use a constraints map and call validate().

I didn't prefix grails for any reason in the demo project. That is just the default that IDEA uses creating classes via their helpers.

gcstang commented 11 years ago

Excellent information.

Thank you for you help I'll give it a try.

On Thu, Mar 21, 2013 at 4:02 PM, Christian Oestreich < notifications@github.com> wrote:

I can't really tell you the issue without debugging the code directly, but what I will say is that using Domain objects as service method in/out params can cause side effects like this to occur since you are dealing with unbound/non-persisted instances of domain classes. I don't specifically see where you are using the tax line item in the code above so it might be up the stack a bit, but there will not be an ID on that object since it is essentially just a POGO at that point. If you don't need to persist the in/out you may want to consider moving them into src/groovy and making them simple POGOs and then map to domain classes when you need to persist.

You certainly CAN use domain classes, but when you receive a request you may want to call .save() on it so all the objects have IDs/version/etc. Also before sending a response you would need to call .save() on it or it will always have id/version/etc as 0/null since it isn't a persisted object.

If you are using domain objects simply for constraints there is a @Validatable annotation you can put on POGOs and use a constraints map and call validate().

I didn't prefix grails for any reason in the demo project. That is just the default that IDEA uses creating classes via their helpers.

— Reply to this email directly or view it on GitHubhttps://github.com/thorstadt/grails-cxf/issues/28#issuecomment-15265197 .