Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Django MultipleObjectsReturned while using a legacy database
I am using Djano to develop a simple web app to display and manage database data. I hooked up a MySQL db and used inspectdb to auto generate a model based on the database tables and this is what I got back, which looks good. # This is an auto-generated Django model module. # You'll have to do the following manually to clean this up: # * Rearrange models' order # * Make sure each model has one field with primary_key=True # * Make sure each ForeignKey has `on_delete` set to the desired behavior. # * Remove `managed = False` lines if you wish to allow Django to create, modify, and delete the table # Feel free to rename the models, but don't rename db_table values or field names. from __future__ import unicode_literals from django.core.exceptions import MultipleObjectsReturned from django.db import models class Booking(models.Model): class Meta: managed = False db_table = 'Booking' unique_together = (('hotelno', 'guestno', 'datefrom'),) hotelno = models.OneToOneField('Hotel', models.DO_NOTHING, db_column='hotelNo', primary_key=True) # Field name made lowercase. guestno = models.IntegerField(db_column='guestNo') # Field name made lowercase. datefrom = models.DateTimeField(db_column='dateFrom') # Field name made lowercase. dateto = models.DateTimeField(db_column='dateTo', blank=True, null=True) # Field name made lowercase. roomno = models.OneToOneField('Room', models.DO_NOTHING, db_column='roomNo') # Field … -
Def Str gives Manager isn't accessible via modelname instance
When trying to display the id in the admin, it states the manager isn't accessible through the QvDatareducecfo instance. class QvDatareducecfo(models.Model): cfo_fname = models.CharField(db_column='CFO_FName', max_length=100, blank=True, null=True) # Field name made lowercase. cfo_lname = models.CharField(db_column='CFO_LName', max_length=100, blank=True, null=True) # Field name made lowercase. cfo_ntname = models.OneToOneField(settings.AUTH_USER_MODEL,db_column='CFO_NTName',primary_key=True, serialize=False, max_length=7) # Field name made lowercase. cfo_type = models.IntegerField(db_column='CFO_Type', blank=True, null=True) class Meta: managed = False db_table = 'QV_DataReduceCFO' def __str__(QvDatareducecfo): qv = QvDatareducecfo.objects.all() return (qv.cfo_ntname) When I try the following below it will give me the error 'QvDatareducecfo' object is not callable def __str__(QvDatareducecfo): qv = QvDatareducecfo() return (qv.cfo_ntname) How can I use the cfo_ntname in the def__str__ call? -
relating template tag to dictionary in views.py in Django
I'm building a resources page, and I'm partitioning it among three available languages. For each language, there will be a set of tags, and for each tag there will be a set of links for a certain item. For instance: English: Books: * The lord of the rings * The Silmarillion * Introduction to Calculus * Electricity for dummies Articles: * Why Python is superb (or something) * The Tao of Eating Too Much Sugar (or something) Portuguese: Articles: * Investindo em títulos de Tesouro And so forth and so on. You may notice that under "Portuguese" there isn't a Books tag. And that's the behavior I want: If the number of links which have a relationship with that specific tag is not greater than 0, then the tag should not show up. That said, this is my models.py: # tags class Tag(models.Model): title = models.CharField(max_length=50, blank=False, unique=True, error_messages={'unique':"Esta tag já existe."}) def __str__(self): return self.title # link instances class Link(models.Model): title = models.CharField(max_length=100, blank=False) url = models.URLField(blank=False) language = models.CharField(max_length=10, blank=False) tag = models.ForeignKey(Tag, on_delete=models.CASCADE, null=False, blank=False) def __str__(self): return self.title def get_absolute_url(self): return reverse("link_detail", kwargs={'pk': self.pk}) And a snippet from my resources_list.html: {% for tag in tags %} … -
Django: Keep values after faild submition
I know there are similar questions, but I'm not capable of getting this done. How do I return the form with the completed values by the user? Right now, it returns the form with the the message errors, but no the previous values. class RegistroView(View): ls_tipos_de_documento = TipoDocumento.objects.values_list('id', 'nombre_corto') ls_habilidades = Habilidad.objects.values_list('id', 'nombre') ls_especialidades = Especialidad.objects.values_list('id', 'nombre') def get(self, request): nana_form = NanaForm() context = {'nana_form': nana_form, 'ls_tipos_de_documento': self.ls_tipos_de_documento, 'ls_especialidades': self.ls_especialidades, 'ls_habilidades': self.ls_habilidades, } return render(request, 'app_administrador/crear-registro-como-secretaria.html', context) def post(self, request): nana_form = NanaForm(request.POST, request.FILES) if nana_form.is_valid(): nana_form.save() else: context = {'nana_form': nana_form, 'ls_tipos_de_documento': self.ls_tipos_de_documento, 'ls_especialidades': self.ls_especialidades, 'ls_habilidades': self.ls_habilidades, } return render(request, 'app_administrador/crear-registro-como-secretaria.html', context) # return HttpResponseRedirect('/') -
Check if any date in a range is between another range
I have the following situation: This is my views.py: def home(request): date = datetime.date.today() start_week = date - datetime.timedelta(date.weekday() + 1) end_week = start_week + datetime.timedelta(6) week_tasks = Task.object.filter(owner=request.user, start_date__range=[start_week, end_week]) context = {} context['week_tasks'] = week_tasks return render(request, 'home.html', context) This view check if the start_date (DateField) is inside the range of the current week. But I have another field on the database, end_date, and I want to check if any value of this range is on the current week. Check the exemple: Let's supose that the current week is the week of the day 17. With my current view, only the All Day Event and Conference belong to the week. I need to show that all these events belong to the week. Obs.: I can't just check if start_date and end_date are in the week, because I have the situation of the Long Event, that starts before the week and ends after. -
Django check for duplicates function not working
I need to check for duplicates before I save new data to sqlite in Django. I have a function that should: get the current database and put it in a dataframe concatenate the df of the data currently in the database with df of proposed new additions do a symmetric difference operation on the indexes of the two dfs return a df of just the unique records from the symmetric difference operation. It does not. def checkforduplicates(weatherstats_df): qs = WeatherStatistics.objects.all() currentdf = read_frame(qs) currentdf = currentdf.drop(currentdf.columns[0], axis=1) print(currentdf) print(weatherstats_df) weatherstats_df = pd.concat([currentdf, weatherstats_df]).loc[ currentdf.index.symmetric_difference(weatherstats_df.index) ] return weatherstats_df If it was dropping dups properly then it would return an empty df with the examples I have been testing, but it doesn't seem to. It also doesn't seem to want to drop the first column of current_df. What am I doing wrong? -
Custom migrations in Django from JSON file?
I'm trying to import some initial data into a database in Django from a JSON file and can't for the life of me figure out how to do it in a custom migration. My first function returns dictionaries with fields that match up with the model Mineral in my database. The first two lines of the second function are taken from the Django 1.11 docs on custom migrations, and the rest is just supposed to loop through the JSON file, make dictionaries with the first function, and then create() them, with the keyword arguments coming from the dictionary. But when I try to run it I get django.db.transaction.TransactionManagementError: An error occurred in the current transaction. You can't execute queries until the end of the 'atomic' block. Right now my custom migration file looks like this: from __future__ import unicode_literals from django.db import migrations, IntegrityError import json def make_mineral_dict(mineral): """Make a dictionary out of a mineral object from JSON file""" fields = { 'name': None, 'image filename': None, 'image caption': None, 'category': None, 'formula': None, 'strunz classification': None, 'crystal system': None, 'unit cell': None, 'color': None, 'crystal symmetry': None, 'cleavage': None, 'mohs scale hardness': None, 'luster': None, 'streak': None, 'diaphaneity': None, … -
Displaying Django Form Results
I have a Django Form (ModelForm) which has a number of fields. When the user presses submit these are then saved to a database. What I am struggling to work out is, how do I then output/render these results in some other HTML page. Models.py from django.db import models # Create your models here. class Contract(models.Model): name = models.CharField(max_length=200) doorNo = models.SlugField(max_length=200) Address = models.TextField(blank=True) Forms.py from django import forms from contracts.models import Contract class GenerateContract(forms.ModelForm): class Meta(): model = Contract fields = '__all__' Views.py from django.shortcuts import render from contracts.forms import GenerateContract # Create your views here. def index(request): return render(request, 'contracts/index.html') def contractview(request): form = GenerateContract() if request.method == "POST": form = GenerateContract(request.POST) if form.is_valid(): form.save(commit=True) return index(request) else: print('ERROR') return render(request,'contracts/contracts.html',{'form':form}) At the moment, I am returning the 'Index' Home page of the app as a placeholder. -
Attach page to all root page trees
In wagtail how would I attach a root page (and it's tree) to all sites root pages? e.g. - I have sites 1.com, 2.com with root pages set to 1 Home Page, 2 Home Page under the wagtail "Root". Now... let's say these sites both share a blog.... How do I set the blog to both of these sites? I'd have to add it under their root pages individually which is redundant. Moreover, this is a more general problem since sites can also share static pages. So, since wagtail uses a tree structure should I just add an extra level to the root? Even doing this.... I'd then have to override teh serve in the root page I set to proxy the proper pages I want. This seems very clumsy. Given that wagtail can manage differnt sites easily I think I'm overlooking something that helps interllink pages between sites. -
I'm writing a library system, and I'm getting this Django Error Message
I'm writing a library system, and I'm getting this Django Error Message: Cannot assign "'1'": "BookInfo.purchase_sn" must be a "PurchaseOrderInfo" instance. and it also show the same message on author_sn, author_type.... and all the foreginkey fields. Below are my view and my model. What Am I doing wrong? my view is : def book_add_new(request): print(request.POST) book_add_info = BookInfo(book_sn=request.POST['this_bk_sn'], voucher_sn=int(request.POST['vochr_sn']), book_genre=request.POST['bk_genre'], book_state=request.POST['bk_state'], book_group_sn=request.POST['cpy_group'], book_classification=request.POST['bk_classification'], book_primary_title=request.POST['primry_title'], book_secondary_title=request.POST['scndry_title'], author_sn=request.POST['authr_sn'], author_type=request.POST['authr_type_sn'], publisher_sn=request.POST['puplshr_sn'], publishing_country=request.POST['cntry_sn'], book_price=request.POST['bk_price'], book_isbn=request.POST['bk_isbn'], book_edition=request.POST['bk_edition'], publish_date=request.POST['bk_year'], book_page_count=request.POST['page_count'], purchase_sn=request.POST['prchs_sn'], book_in=1) book_add_info.save() return render(request, 'book_management/book_add_new_page.html') My Model: class PurchaseOrderInfo(models.Model): purchase_sn = models.IntegerField(primary_key=True) purchase_owner = models.TextField(blank=True, null=True) order_date = models.DateField(blank=True, null=True) order_scan = models.BinaryField(blank=True, null=True) class Meta: managed = True db_table = 'purchase_order_info' class BookInfo(models.Model): book_classification = models.TextField(blank=True, null=True) book_isbn = models.TextField(blank=True, null=True) book_secondary_title = models.TextField(blank=True, null=True) book_group_sn = models.IntegerField(blank=True, null=True) voucher_snv = models.ForeignKey(BookVoucher, models.DO_NOTHING, db_column='voucher_sn', blank=True, null=True) book_primary_title = models.TextField(blank=True, null=True) purchase_sn = models.ForeignKey(PurchaseOrderInfo, models.DO_NOTHING, db_column='purchase_sn', blank=True, null=True) book_page_count = models.IntegerField(blank=True, null=True) book_sn = models.IntegerField(primary_key=True) book_genre = models.ForeignKey(BookGenres, models.DO_NOTHING, db_column='book_genre', blank=True, null=True) book_state = models.ForeignKey('BookState', models.DO_NOTHING, db_column='book_state', blank=True, null=True) book_edition = models.IntegerField(blank=True, null=True) publish_date = models.IntegerField(blank=True, null=True) book_price = models.TextField(blank=True, null=True) # This field type is a guess. author_sn = models.ForeignKey(AuthorInfo, models.DO_NOTHING, db_column='author_sn', blank=True, null=True) author_type = models.ForeignKey(AuthorType, models.DO_NOTHING, db_column='author_type', blank=True, null=True) publisher_sn = models.ForeignKey(PublisherInfo, … -
Django - Is it necessary to clean BooleanField in forms?
As the title says. BooleanField are simply displayed as checkboxes - is it necessary to clean them before processing them? Or is cleaning only necessary to fields like CharField? -
Django - ChoiceField cleaned_data gets String instead of Integer
I have a form field called 'units' like this: units = forms.ChoiceField(choices=[(x, x) for x in range(1, 11)], help_text = 'Units: ') When I do form.cleaned_data['units'] I get a String instead of an Integer. How can I change the field to get the Integer? -
How to restart my dev django sqlite + create admin user in one command?
This is intended as a community wiki question, after going through the hardship of resetting my django migrations. The main problem was -> resetting the migrations. the other stuff is easy. So, how do you reset your django table, when you're just starting to develop and make frequent changes to your models? -
Cannot import module in script when fed to manage.py
I have a script that defines a function and then runs it from datetime import timedelta def foo(): return timedelta(days=2) print(foo()) If I open a shell and run the script, everything runs fine: ./manage.py shell In [1]: %run web/the_script.py # Using Ipython 2 days, 0:00:00 But when I run the script as input for ./manage.py shell (I want to run the script as a cron job) it fails like this: ./manage.py shell < the_script.py Traceback (most recent call last): File "./manage.py", line 22, in <module> execute_from_command_line(sys.argv) File "/home/satan/Development/envs/p3_env/lib/python3.5/site-packages/django/core/management/__init__.py", line 363, in execute_from_command_line utility.execute() File "/home/satan/Development/envs/p3_env/lib/python3.5/site-packages/django/core/management/__init__.py", line 355, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/home/satan/Development/envs/p3_env/lib/python3.5/site-packages/django/core/management/base.py", line 283, in run_from_argv self.execute(*args, **cmd_options) File "/home/satan/Development/envs/p3_env/lib/python3.5/site-packages/django/core/management/base.py", line 330, in execute output = self.handle(*args, **options) File "/home/satan/Development/envs/p3_env/lib/python3.5/site-packages/django/core/management/commands/shell.py", line 101, in handle exec(sys.stdin.read()) File "<string>", line 8, in <module> File "<string>", line 5, in foo NameError: name 'timedelta' is not defined Can someone explain what is happening please? -
Alternate between not serving static files and 502 bad gateway error for Django
I've been trying to get this Django website deployed for a week. However, I'm brand new to servers, the internet, Django, Nginx, etc. I'm using the Django one-click-image and I have followed all the tutorials, instructions, stackoverflow questions etc. I've gotten so close to having the settings right, I can taste it. I can get the html template deployed but it won't deploy the static files (well, the css or an img at least) according to many hours on the internet I'm not serving them properly. Some searches I did wanted me to adjust gunicorn.conf... but it doesn't seem to exist on my image. I'm going to give more info than I should sorry, but there's a lot of common mistakes and I need you to know I've already covered that territory If I just leave the settings.py to have STATIC_URL = '/static/' my basic html template comes up but it will not load the css... or even an image in that folder when I tried that. If I give it any other STATIC related constants I get a 502 Bad Gateway. Things I put in were like: STATICROOT = os.path.join(os.path.dirname(BASEDIR), 'static') STATICFILESDIRS = ( os.path.join(BASEDIR, 'static'), ) STATICFILES_FINDERS = … -
Postgresql migration (from local machine to digital ocean)
I want to move my local Postgresql database (preloaded with data) into my digitalocean droplet. 2 challenges I'm facing: the /data/base/25760 is the folder with my data, do I SCP this directly into Digital Ocean Root/home/django/django-project? How do I link the database to the droplet using the settings.py file? I'm getting errors: FATAL: password authentication failed for user "root" From my search, it looks like users are not advised to load their local databases directly into their VPS, maybe I'm wrong about this. thanks very much! -
How do I mutate existing data with GraphQL, Graphene and Relay?
I feel like it should be documented somewhere but I cant find it. I can add data to my db with a mutation but I cant change it. Graphene works with Django and my db is SQLite Its quite specific, I hope someone knows the answer. Among other things I tried: mutation AppMutation( $input: AddSchoolNodeInput! ) { addSchool(input: $input) { school { id name description } } } where AddSchoolNodeInput! is ("U2Nob29sTm9kZToxMQ==" is an existing id): { "name": "edit kaas", "description": "edit fails", "clientMutationId":"U2Nob29sTm9kZToxMQ==" } it create a new item and returns this: { "data": { "addSchool": { "school": { "id": "U2Nob29sTm9kZToxNA==", "name": "edit kaas", "description": "edit fails" } } } } -
Dictionary Index of dictionary contained in a list in Django template
Im trying to print all dictionaries which are contained in a list into a list in a Django template. Its in JSON form from [https://data.dublinked.ie/cgi-bin/rtpi/realtimebusinformation?stopid=184&format=json ] I have <ul> {% for key, value in results.0.items %} <li>{{key}} {{value}}</li> {% endfor %} </ul> in my template which outputs the first dictionary at position 0 from the list. The amount of dictionaries in the list is always changing so I'm looking to have them all printed depending on how many are in the list. Any help? -
load-testing heroku django+postgres: response time rises than falls
I am testing my Django app using Locust. I noticed a strange thing when applying load to the web server: the response time rises until it peaks (usually within 10 seconds after load start) and then goes down until it stabilizes. At the same point the number of requests per second goes down and then back up. Examples: The load is POST requests with UUIDs and delivery statuses (emulating message delivery updates). The backend that receives requests does just one thing - it makes one single update to Postgres DB: @csrf_exempt def easysms_webhook(request): """ Вебхук доставки сообщений для сервиса Easy SMS. """ data = json.loads(request.body.decode('utf-8')) delivered = False if data['status'] == 0: status = ViberSMDelivery.OK delivered = True elif data['status'] == -1: status = ViberSMDelivery.ERROR elif data['status'] == 1: status = ViberSMDelivery.PROCESSING elif data['status'] == 5: status = ViberSMDelivery.READ delivered = True else: logger.error('Unsupported data status: {}'.format(data['status'])) return HttpResponse() try: ViberSMDelivery.objects.filter(uuid=data['group_id']).update( status=status, delivered=delivered ) except ViberSMDelivery.DoesNotExist: logger.error('ViberSMDelivery for %s is not exists', data['group_id']) return HttpResponse() So my question is - why does it always peak before decreasing? It looks like every time it takes Heroku webserver several seconds to "get used" to load. Why is that? Or is this some … -
get user with token django rest framework
sorry for my english. Is not good. I work with rest framework django. i want get user with Token auth for activate this user but, I can not do it. for send a request, i use postman. this my config for request: url type: POST param body: key: -- user token -- (take in the admin page) this is my view class Activate(generics.ListCreateAPIView): """ activate: Activate a new user. """ serializer_class = serializers.UserBasicSerializer def get_queryset(self): return models.Member.objects.filter() def post(self, request, *args, **kwargs): user = Token.objects.get(*args, **kwargs).user # user = activation_token.user user.is_active = True user.save() thanks -
Django: "<...>" needs to have a value for field "id" before this many-to-many relationship can be used
This is my method save on my form.py file. This is the ErroValue: Exception Type: ValueError Exception Value: "<Nana: E>" needs to have a value for field "id" before this many-to-many relationship can be used. 1.-I understand that I'm saving my Nana not at the correct time. What Am I doing wrong? 2.-'habilidades' and 'especiliades' are select mutiple fields in html. I need to save that date to the "Nana" model. @transaction.atomic() def save(self): valid_data = self.cleaned_data documento_codigo = valid_data.pop('documento') documento_tipo_id = valid_data.pop('tipo_documento') documento = Documento(codigo=documento_codigo, tipo_documento_id=documento_tipo_id) documento.save() #habilidad habilidades_nombre = valid_data.pop('habilidades') habilidades_habilidades = Habilidad(habilidades_nombre) habilidades_habilidades.save() nana = Nana(documento=documento, **valid_data) nana.save() nana.habilidades.add(habilidades_habilidades) return nana My form (without method save): class NanaForm(forms.Form): nombre = forms.CharField(label='Nombre', max_length=200) apellido_paterno = forms.CharField(label='Apellido paterno', max_length=100) apellido_materno = forms.CharField(label='Apellido materno', max_length=100) fecha_de_nacimiento = forms.DateField(label='Fecha de nacimiento') documento = forms.CharField(label='Documento', max_length=60, required=True) tipo_documento = forms.CharField(label='Tipo de documento', max_length=100) direccion = forms.CharField(label='Dirección', max_length=100) telefono_o_celular = forms.CharField(label='Teléfono o celular', max_length=14) latitud = forms.CharField(label='Latitud', max_length=100) longitud = forms.CharField(label='Longitud', max_length=100) genero = forms.CharField(label='Género', max_length=100) habilidades = forms.CharField(label='Habilidades', max_length=100) especialidades = forms.CharField(label='Especialidades', max_length=100) # habilidades = forms.MultipleChoiceField(label="Habilidades", required=False, widget=forms.SelectMultiple) # especialidades = forms.MultipleChoiceField(label="Especialidades", required=False, widget=forms.SelectMultiple) foto = forms.ImageField(required=False) -
Django AngularJS CORS Error
I'm using django 1.11.7 and I've installed django-cors-hearders. I've been trying to send custom headers in POST request to my DRF application but I'm getting the following error: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:3000' is therefore not allowed access. The response had HTTP status code 400 localhost:3000 is where the calling application is hosted. The javascript POST request has the following headers: headers.append('Access-Control-Allow-Origin','*'); headers.append("Access-Control-Allow-Methods", "GET, HEAD, OPTIONS, POST, PUT"); headers.append("Access-Control-Allow-Headers","Origin, header-one, X-Requested-With, Content-Type, Accept, Authorization, If-Modified-Since, Cache-Control, Pragma"); headers.append('Content-Type', 'text/JSON'); headers.append('header-one', "value@123"); I have tried the following: 1) Modified my django app if str(request.method).lower() == 'options': headers = { "Access-Control-Allow-Origin": "*", "Access-Control-Allow-Methods": "POST", "Access-Control-Allow-Headers": "HTTP_HEADER_ONE" } return Response({}, headers=headers, status=status.HTTP_200_OK) 2) Commented out this line in settings.py: 'django.middleware.clickjacking.XFrameOptionsMiddleware' because apparently it intereferes with the cors middleware. 3) Added the following code to settings.py INSTALLED_APPS = [.... 'corsheaders', ... ] MIDDLEWARE = [ 'corsheaders.middleware.CorsMiddleware', ... ] 4) CORS configuration: CORS_ORIGIN_ALLOW_ALL = True from corsheaders.defaults import default_headers CORS_ALLOW_HEADERS = default_headers + ( 'header-one', ) And now I get this error: Request header field Access-Control-Allow-Origin is not allowed by Access-Control-Allow-Headers in preflight response. What am I doing wrong? -
adding age field to user creation with python_social_auth googleOauth2
I'm currently working on a web platform witch implement google+ login. At the moment I can register a new user with googleOauth2 by getting his username and email address. Social_auth create my user by calling my method create_user defined in models.py. def create_user(self, email, password=None, nom=None, prenom=None, age=None, username=None): What I want is social_auth provide age , first name and last name when calling create_user. -
Django: is a model for the current day only justified for performance reasons?
I want to build a website that essentially asks each day a new set of questions to its members. I plan that 90% of the load will be queries for the current day (list of the current questions, post answers to current questions). Would it be more advised (for performance reasons) to split my Question model in two: HQuestion (for historical) and CQuestion (questions for the current day) and move each day (at 0:00) questions from C to H? Another possible advantage, in Django Rest Framework it would eliminate the need to validate if a post is sent to a current question (the only admitted) since the post would be possible only for a CQuestion instance in the split-model scenario. I would like to have your opinion about that, pros and cons, etc. -
Passing soapAction false to suds
I have a SOAP webservice wrote in Java and I call it with suds library: def soapclient(request): username='user' password='pwd' base64string = base64.encodestring('%s:%s' % (username, password)).replace('\n', '') authenticationHeader = { "SOAPAction" : "ActionName", "Authorization" : "Basic %s" % base64string } client = Client('http://my_ult_to_file?wsdl', headers=authenticationHeader) var=dict(utenteApplicativo='aaaaa', pageNumber=1, pageSize=1, carrelloDto=dict(idCarrelloSorgente='99999999994', itemCarrelloDtoList=dict(causale='prova', codiceEnte='ente', importo=2, importoImposta=1, importoTotale=3, importoUnitario=2, quantitaItem=1, tipoContabilizzazione='TA')) ) result = client.service.creaCarrello(var) return render_to_response('soapclient.html', {'var': result}) but I receive the error: Server raised fault: 'The given SOAPAction ActionName does not match an operation.' In the wsdl file soapAction is not setted: <wsdl:operation name="creaCarrello"> <soap:operation soapAction="" style="rpc"/> <wsdl:input name="creaCarrello"> <soap:body namespace="http://infocamere.it/pagamentionlinews" use="literal"/> </wsdl:input> There is a manner to set soapAction in the client to a value false or similar?